I have created the baseline of the program, and it works well, but I want it to be able to save the password generations, and store them under an index name in SQLite. I want it to be so that I can always access the previously generated passwords.
Code:
def gen_password():
letters = string.ascii_letters
random_letter = random.choice(letters)
random_num = random.randint(0,9)
letter_or_num = ["letter","number"]
char_num = int(input("How many characters do you want in your password?: "))
for i in range(char_num):
random_var = random.choice(letter_or_num)
if random_var == "letter":
random_letter = random.choice(letters)
print(random_letter, end = "")
elif random_var == "number":
random_num = random.randint(0,9)
print(random_num, end = "")
print("")
gen_password()
I hope this will solve your problem: