0
What's wrong??
7 Antworten
+ 1
You should convert the input to integer type. Also this would be a better way to do it, ask the user again for the password if it is not equal to code.
code = 911
while True:
print('enter password')
password = int(input())
if password == code:
break
else:
print('invalid password, try again')
print('access granted')
+ 2
𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 we usually do that to lazy users, he actually shared the code and I have replied with a reason to solve the problem and made some update to make it more readable. It's up to the user to implement it or not.
0
But it says EOP reading line
0
Ugonna Muoneme the sololearn playground works differently, run it on some other IDE. The one here is not so good with user interactions.
0
Thank you