usernames = ['a','b','c','d','e']
passwords = ['aa','bb','cc','dd','ee']
passwords = tuple(passwords)
id = input ("Please enter your ID")
pw = input ("Please enter password: ")
if id == usernames[0] and pw ==passwords[0]:
print ('success')
else:
print ('Failure")
If you receive a and aa, it says success
usernames = ['a','b','c','d','e']
passwords = [1,2,3,4,5]
passwords = tuple(passwords)
id = input ("Please enter your ID")
pw = input ("Please enter password: ")
if id == usernames[0] and pw ==passwords[0]:
print ('success')
else:
print ('Failure")
If we get a and 1 here, do we say that we failed?
Is it because the numbers in the passwords are numbers?
How should I change it to say success when it's a number?
python
Modify passwords=[1,2,3,4,5]
to passwords=['1','2','3','4','5']
© 2025 OneMinuteCode. All rights reserved.