Help me | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Help me

Can someone explain what is wrong with this code ? It stops when I enter a wrong password. https://sololearn.com/compiler-playground/coE7P00c53PI/?ref=app

8th May 2024, 9:38 AM
Shaymon Khawas
Shaymon Khawas - avatar
2 Respostas
+ 1
this code just works, but... can be better: if attempts == 5: print("whatever") move it into the while loop changing the `elif attempts == 0:` condition and see the difference. you don't need to check 2 times the same...
8th May 2024, 12:47 PM
Mihaly Nyilas
Mihaly Nyilas - avatar
+ 2
Your code works fine, if you give *all* the input in the pop-up box, like: abc abc abc abc abc The playground is not interactive. If you only provide one input at the beginning and it does not match the while condition, an EOF error occurs.
8th May 2024, 10:21 AM
Wong Hei Ming
Wong Hei Ming - avatar