samedi 25 avril 2020

module 'random' has no attribute 'randomint'

I have read other post while trying to solve this problem. All of them seem to say that the file is the name random.py but my file name is test.py

I am using sublime text 3 if that makes a difference.

def getAnswer(answerNumber):
   if answerNumber == 1:
       return 'It is certain'
   elif answerNumber == 2:
       return 'It is decidedly so'
   elif answerNumber == 3:
       return 'Yes'
   elif answerNumber == 4:
       return 'Reply hazy try again'
   elif answerNumber == 5:
       return 'Ask again Later'
r = random.randomint(1,5)
fortune = getAnswer(r)
pint(fortune) ```



Aucun commentaire:

Enregistrer un commentaire