JavaScript
x
2
1
playsound.playsound(random.choice(beatboxes))
2
AttributeError: ‘builtin_function_or_method’ object has no attribute ‘choice’
Process finished with exit code 1
there is an alternative to the bultin random module?
Thanks
Advertisement
Answer
To use random with a choice like you write in code you need to import
JavaScript
1
2
1
import random
2
Here In your case
JavaScript
1
2
1
from random import *
2
will now work