Aug-06-2023, 12:14 PM
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")