samedi 6 janvier 2018

Error with random in python 2.7

i have error running this following code in python:

from random import randint

code = "%d%d%d" % (randint(1,9), randint (1,9), randint(1,9))
guess = raw_input(">")
guesses = 0

while guess != code and guesses < 10:
   print "wrong"
   guesses += 1
   guess = raw_input(">")

when i run it in windowpowershell i got this error"ImportError: cannot import name random". i tried to reinstall python but it still not working. Can someone guide me through this? thank you!




Aucun commentaire:

Enregistrer un commentaire