0

Access granted

I want to write a program, when user enters crt password it should show "access granted",but if user enters wrong password it should show "try again" and asks him enter right password one more time,like wise user have 3 chances to enter password, if all 3 chances are used then it should show "access denied". I wrote some code using while loop but it is not working as i expected. Plz help where i went wrong.here is my code https://code.sololearn.com/cnwEh0XQ8d7N/?ref=app

3rd Jul 2020, 8:55 AM
tangella shivareddy
tangella shivareddy - avatar
9 Respostas
+ 6
Can you please use appropriate tags for programming language please? Thanks!
3rd Jul 2020, 9:56 AM
Lothar
Lothar - avatar
+ 3
Please tell us what you expect from this. So that we can tell you where you went wrong
3rd Jul 2020, 9:05 AM
Arctic Fox
Arctic Fox - avatar
0
If user enters wrong password, output should be "try again",and at the same time, user should able to enter(input) password for second time(without running the code again). or tell me for each iteration of while loop, is it possible to give differnt input?
3rd Jul 2020, 9:21 AM
tangella shivareddy
tangella shivareddy - avatar
0
It's working fine for me. Since, it's an online compiler you need to supply all the inputs before running the code. Try entering wrong password three times each on newline, the output will be same as your are expecting.
3rd Jul 2020, 9:34 AM
blACk sh4d0w
blACk sh4d0w - avatar
0
blACk sh4d0w I dont want to enter three inputs at a time, only after knowing first time enterted input wrong i want enter second input . Is it not possible with online compiler?
3rd Jul 2020, 10:12 AM
tangella shivareddy
tangella shivareddy - avatar
0
tangella shivareddy No it's not possible in SL compiler or any other online compiler.
3rd Jul 2020, 12:55 PM
blACk sh4d0w
blACk sh4d0w - avatar
0
Thankyou guys
3rd Jul 2020, 1:00 PM
tangella shivareddy
tangella shivareddy - avatar
0
you gotta input 3 paswords because of how sololearn works, if you do this on a python IDE, it’ll work
4th Jul 2020, 5:49 AM
Pr0C0d3r
Pr0C0d3r - avatar
0
Porn
18th Nov 2022, 2:15 AM
Tim Fucu
Tim Fucu - avatar