Let's generate a ten-character password using a while
loop and random.choice()
.
The final result will be a string of random characters all on one line.
Example output:
Your password: Q45pA%x9PJ
Allow the user to choose how many characters the password will be.
Allow the user to choose how many letters, numbers, and punctuation characters they want in their password. Mix everything up using list()
, random.shuffle()
, and ''.join()
.