Python Forum
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Password Generator
#1
Photo 
So, I've been trying to write this code that would tell me to stop once I entered the wrong password three times in a row and I don't know how to do it. Disclaimer, I'm very new to Python 3. I wrote the python code below for password input but it doesn't prompt me to stop after three attempts. What should I add to this code? or what should I delete so I can achieve what I wanted it to do. Just need some boost and help so I can clear my mind. (^^o) Can't seem to sleep at night when you don't get what you want to happen with your code. A bit of help is appreciated! Thanks!

password = str(input("Please enter password to continue: "))
if password == "fusion":
    print("Welcome! the password is correct, you may enter.")
    exit()

while password != "fusion":
	print("what is the Password?")
	password = input()

while password == "fusion":
	print("Welcome! the password is correct, you may enter.")
	exit()
Thank you,
Josh
Reply


Messages In This Thread
[split] Password Generator - by Fusion777 - Apr-23-2018, 08:00 PM
RE: [split] Password Generator - by MasterGame - Jul-08-2018, 09:27 PM
RE: Password Generator - by duguarun - May-24-2018, 11:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to make a password generator Jankofcik 1 616 Aug-06-2023, 01:22 PM
Last Post: deanhystad
  Random Password Generator with Weird Output. Why? Selenestica 2 2,694 Sep-11-2019, 04:36 AM
Last Post: Selenestica
  receive from a generator, send to a generator Skaperen 9 5,702 Feb-05-2018, 06:26 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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