mardi 27 mars 2018

I am making a charcter and load out selector to spice thing up a little on Rainbow six seige but i am stuck.

>>> import random

#These are the operators guns

Rook = ['MP5','P90','SG-CQB']
Doc = ['MP5','P90','SG-CQB']
Mute = ['MP5K','M590A1']
Smoke = ['FMG-9','M590A1']

#string of all the operators below

Defending_operators = ['Smoke','Mute','Doc','Rook','Castle','Pulse','Kapkan','Tachanka','Jager','Bandit']

Defender = (random.choice(Defending_operators))

what i tried to do is print a random operator and then from what i got, choose a random gun in his load out but i dont know how to do this..

>>>print(Defender)
Rook

>>>if Defender == Rook:

#so below it will say the operator(aka rook in this case), and then the gun it chose from his load out

 print('Rook',random.choice(Rook))

how do i make what guns it chooses from depend on what got printed out above it.. what code would it be and if possible could i have an explanation

Aucun commentaire:

Enregistrer un commentaire