Bugged-up Pass Gen
I have a password generator that I am working on. There are two ways to generate the passwords but I want the user to decide which way they want to. Both of the ways work perfectly, but choosing it doesnât work. Itâs always giving me an error about not defining something. Here is my code below: import random passType = input(âWhat type of password would you like? Types are random characters, and then there are passwords that you can easily remember. Type either âpass1â or âpass2ââ) if passType == pass1: characters = âABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890â def password(arr, passlen=12): random = arr[randoms(0, len(arr))] count = passlen password = ââ for i in range(count): password = password + random random = arr[randoms(0, len(arr))] return password def randoms(min, max): return random.randint(min, max) print(password(characters)) elif passType == pass2: name = input(âWhat is your first name?â) Lname = input(âWhat is the first letter of your last name?â) numbers = input(âType in the string of numbers of your birth day, month, and year. ( no slashes or spaces, just numbers )â) print(name+Lname+numbers)