If you receive a password and match the password you set, you'll be like, "Log in". 다시 Otherwise, I'll try again You must enter it. If the number of password errors is greater than 5 times, re-enter it in 60 seconds I'm going to create a code that does that. The password is 1234.
pwd = int (input ("password input"))
count = 0
while pwd !=1234:
count +=1
if count ==5 :
print ("Re-enter after 60 seconds")
for i in range(1,60+1):
print (60-i 'wait seconds')
count = 0
pwd = int (input ("password input")
print ('Login')
I coded with first, but the lock doesn't work after 5 failures. I would appreciate it if you could let me know the solution.
python
I'm not sure because the indentation of the code you wrote is a little ambiguous, but I think it's because the code that resets the count to 0 is outside the if statement.
if count ==5 :
print ("Re-enter after 60 seconds")
for i in range(1,60+1):
print (60-i 'wait seconds')
count = 0
You can write it like thisYo
And it's a little bit different, but if you execute the code that waits 60 seconds, it'll be over in a second.
There's actually a time-measuring module, so if you're interested, you might want to look it up.
560 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
823 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
581 GDB gets version error when attempting to debug with the Presense SDK (IDE)
558 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.