Python Forum
Trying to make a password generator
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Trying to make a password generator
#1
I'm trying to make a password generator that restarts if you're not satisfied with your password. The generator itself works perfectly, but when I try to add an input function after the while loop (ques2) it doesn't work. How do I fix this?

import random

chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456!@#$%^&"

ques = input("Do you want a new password? ")

if ques=="yes":
    while 1:
        password_len = int(input("What lenght would you like your password to be : "))
        password_count = int(input("How many passwords would you like :"))
        for x in range (0,password_count):
            password = ""
            for x in range(0, password_len):
                password_char = random.choice(chars)
                password = password + password_char
            print("Here is your password: ", password)
            ques2 = input("Are you satisfied with your password? ")
else:
    print("Okay, goodbye")
deanhystad write Aug-06-2023, 01:08 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
Trying to make a password generator - by Jankofcik - Aug-06-2023, 12:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to make bot that sends instagram auto password reset code kraixx 2 2,670 Mar-04-2023, 09:59 PM
Last Post: jefsummers
  help me to make my password list in python >>> Oktay34riza 0 1,039 Dec-23-2022, 12:38 PM
Last Post: Oktay34riza
  how to make my function be a generator Skaperen 2 2,674 Jan-27-2020, 01:07 AM
Last Post: Skaperen
  Random Password Generator with Weird Output. Why? Selenestica 2 3,515 Sep-11-2019, 04:36 AM
Last Post: Selenestica
Photo [split] Password Generator Fusion777 2 3,120 Jul-08-2018, 09:27 PM
Last Post: MasterGame
  receive from a generator, send to a generator Skaperen 9 7,325 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