I'm trying to generate a unique password with a function. Everything works fine, except "".join
. Help me see whats the problem in the code? Using Python 3.7.
My code:
import random
import string
def password():
a = []
letters = string.ascii_letters
symbols = string.punctuation
for element in range(6):
a.append(random.randint(0, 10))
a.append(random.choice(letters))
a.append(random.choice(symbols))
random.shuffle(a)
print(''.join(str(a)))
password()