import random as r
list = ['left','right','center']
shoot = r.choices(list)
print('python says, shoot ' + str(shoot))
How can I get it to output just left or right or center instead of ['left']
The method random.choices make multiples choice, use random.choice
import random as r
values = ['left','right','center']
shoot = r.choice(values)
print('python says, shoot', shoot)
Note
list as variable name, that's python list constructorshoot is already a string, no need of str()
random.choice()w/os.