PW Akshay


generate functionMon, 28 Nov 2022

import random from string import * constants = ascii_letters + digits + punctuation print(constants) password_length = int(input("What's the length of the password? ")) password = "" for i in range(password_length): password += random.choice(constants) print(password) #create a program loop of above code until user says to close it

while True: choice = input("Would you like to restart the program?") if choice == 'yes': continue elif choice == 'no': print('Thank you for using this program!') break else: print('Please enter yes or no') continue

Questions about programming?Chat with your personal AI assistant