Python Forum
How do i add limits to this code ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do i add limits to this code ?
#4
Another option is a for loop instead of a while loop.

for _ in range(5): # Will loop exactly 5 times
  answer1 = input("Password: ")
  if answer1 != "123":
    print("Wrong Password")
    continue
  else:
    print("Welcome!")
    break
Reply


Messages In This Thread
How do i add limits to this code ? - by learn1 - Feb-07-2020, 01:00 AM
RE: How do i add limits to this code ? - by Larz60+ - Feb-07-2020, 01:11 AM
RE: How do i add limits to this code ? - by stullis - Feb-07-2020, 02:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Thread Limits . . . JohnnyCoffee 10 1,688 Mar-03-2023, 04:07 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020