Replies: 3 comments 4 replies
-
Hello, jerry, you are missing indentation after for loop, and instead of print(password_list) give print(''.join(password_list)) |
Beta Was this translation helpful? Give feedback.
2 replies
-
-----------MARK IT AS ANSWERD IF IT HELPS----------- |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to build an APP that randomly generate password from only numbers, alphabet and characters using python framework. I am getting some errors
import random
letters = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z",
"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
numbers = ["0","1","2","3","4","5","6","7","8","9"]
symbols = ["!","@","+","$","#","&","*","-"]
print("Welcome to my Password Generator App")
print()
n_letters = int(input("How many letters do you like in your password:\n"))
n_numbers = int(input("How many numbers do you like in your password:\n"))
n_symbols = int(input("How many symbols do you like in your password:\n"))
password = ""
password_list = []
for i in range(1,n_letters + 1):
password_list.append(random.choice(letters))
for i in range(1,n_numbers + 1):
password_list.append(random.choice(numbers))
for i in range(1,n_symbols + 1):
password_list.append(random.choice(symbols))
for i in password_list:
password = password + i
print(password_list)
Beta Was this translation helpful? Give feedback.
All reactions