Aug-06-2023, 12:14 PM
(This post was last modified: Aug-06-2023, 01:08 PM by deanhystad.)
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?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
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.
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.