Ask coding questions

← Back to all posts
Why does this code not work?
112596 (23)

It throws me a:

Traceback (most recent call last):
File "main.py", line 29, in <module>
main_loop()
File "main.py", line 17, in main_loop
space_1=random.choice(num_1," ")
TypeError: choice() takes 2 positional arguments but 3 were given

What did I do wrong?

Comments
hotnewtop
IntellectualGuy (693)

Because You're Supposed to pass in a list of values, so I would recommend putting the values in a list, and then passing it in as a parameter.