Jump to content

 

5 minutes ago, OnyxArmos said:

random.randint(-1,1)

i though of that as well but it won't work.

random.randint(-1,1)
Traceback (most recent call last):
  File "<input>", line 2, in <module>
AttributeError: 'builtin_function_or_method' object has no attribute 'randint'

Link to post
Share on other sites

14 minutes ago, erikpc43 said:

 

i though of that as well but it won't work.

random.randint(-1,1)
Traceback (most recent call last):
  File "<input>", line 2, in <module>
AttributeError: 'builtin_function_or_method' object has no attribute 'randint'

I think you have to import random at the top of your program.

 

And then you can use random.randint(-1,1) or any random.methods.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×