Choosing a password length
Some websites require passwords to be a certain length. Let’s allow the user to choose the length of their password.
-
First, ask the user to input a password length, and store it in a variable called
length
. -
Use
int()
to turn the user’s input into a whole number. -
Use your
length
variable to repeat as many times as the user entered. -
Test your code. The password created should be the length entered by the user.