PW Akshay

Generation

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) ## do not close the above program after execution rather rerun it

def run_again(): while True: again = input("Do you want to run again? ") if again == "yes": return True elif again == "no": return False

Questions about programming?Chat with your personal AI assistant