You should also read:

Gerador de senhas em Python

import stringimport randomdef randompassword(): special_chars = '~@!?/%$#*^`´;:' chars = string.ascii_uppercase + string.ascii_lowercase + string.digits + special_chars size = random.randint(30, 32) return ''.join(random.choice(chars) for…