0

This is the code:

ans2 = input("What will be your user id?: ")
ans3 = int(input("Code: "))

print("Done!")

login = input("Credits noted! Hit 'ENTER' to login: ")

def login():
    userid = input("Enter your user id: ")
    if userid==ans2:
        print("User found")
    else:
        print("User not found")
        
    password2 = input("Password: ")
    
    if password2==ans3:
        print("Commiting oraa.....")
    else: 
        print("Nuclear codes not correct. Try again....")
    pass

if login==login:
    login()

This is working just fine but when I enter password2, it says 'Nuclear codes not correct. Try again....'

khelwood
  • 55,782
  • 14
  • 81
  • 108
Juju Baba
  • 1
  • 1
  • That's because you have converted `ans3` to an integer, but `password2` is a string. They will never compare equal. Choose one or the other. – Tim Roberts Mar 20 '23 at 17:31

0 Answers0