10th May 2020, 5:27 PM
Ugonna Muoneme
Ugonna Muoneme - avatar
7 Respostas
+ 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')
10th May 2020, 5:33 PM
Avinesh
Avinesh - avatar
+ 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.
10th May 2020, 5:40 PM
Avinesh
Avinesh - avatar
0
But it says EOP reading line
10th May 2020, 5:38 PM
Ugonna Muoneme
Ugonna Muoneme - avatar
0
Ugonna Muoneme the sololearn playground works differently, run it on some other IDE. The one here is not so good with user interactions.
10th May 2020, 5:42 PM
Avinesh
Avinesh - avatar
0
Thank you
10th May 2020, 5:42 PM
Ugonna Muoneme
Ugonna Muoneme - avatar