Answer the question
In order to leave comments, you need to log in
How to assign an index to a single element?
import random
ch1 = {'name': 'x, 'damage':10, 'hp':130, 'miss':0.1, 'dodge':0.7}
ch2 = {'name': 'y', 'damage':40, 'hp':160, 'miss':0.5, 'dodge':0.4}
ch3 = {'name': 'z', 'damage':70, 'hp':180, 'miss':0.7, 'dodge':0.2}
ch4 = {'name': 'f', 'damage':30, 'hp':140, 'miss':0.3, 'dodge':0.6}
a = random.randint(1,4)
b = random.randint(1,4)
while a==b:
b=random.randint(1,4)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question