You are viewing a single comment's thread from:

RE: Day 7 of learning python 🐍. Today's project – a password generator in Python. ...

in DBuzz β€’ 2 years ago (edited)

Another tip, there are some great built in functions using the string library to get those letter sets. Try these out for example:

import string
print(string.ascii_uppercase)
print(string.ascii_lowercase)
print(string.ascii_letters)
print(string.digits)
print(string.printable)

They will output what you need automatically:

ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
0123456789
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~