vendredi 30 octobre 2020

Randint is not working and i have no idea why

import turtle#importer turtle pour pouvoir l'utiliser import random from random import random #importer random pour pouvoir laisser le choix à l'ordinateur. Le choix sera aléatoire. #pour pouvoir utiliser screen turtle, demanderdes questions à l'utilisateur from turtle import Screen, Turtle #from random import random

is there a problem in the way i coded this? My problem is that after this, when i try to use randint like so:

turtle.forward(random.randint(100,400))

it gives me this error:

Traceback (most recent call last): File "/Users/ritamansour/Desktop/tyfkgjhv.py", line 62, in turtle.right(random.randint(1,360))#met que ce soit un random chiffre ici AttributeError: 'builtin_function_or_method' object has no attribute 'randint'

I dont understand where the problem is, because randint is apart of import random. If you need to see the full code, let me know. Thank you.




Aucun commentaire:

Enregistrer un commentaire