0

What does "TypeError:choice() takes exactly 1 arguments (4 given)" mean

I'm trying to do something like print(random.choice(one, two, three, four)) where one, two, three, etc, were previously defined. Why doesn't it work? Thanks for helping!

20th Dec 2018, 4:49 AM
Aaron S
Aaron S - avatar
1 Réponse
+ 2
You need to make them into a list first. And use the list as argument to choice() print(random.choice([one, two, three, four] ))
20th Dec 2018, 5:19 AM
Gordon
Gordon - avatar