mercredi 9 septembre 2020

Why does it say its the wrong code entered even though its the same as the key

I am trying to make a quest in python terminal but when i try to compare two code it says its wrong

import time
import random

def adventure():
   
    key = random.randint(111,999)

    delay = 1

    print()
    print("the code is", key)
    
    time.sleep(delay)

    uk = input("do you remember the code?")

    if uk is key:
        print("Good")

    else:
        print("wrong code")



Aucun commentaire:

Enregistrer un commentaire