Password Generator

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.

    screenshot

  • Use int() to turn the user’s input into a whole number.

    screenshot

  • Use your length variable to repeat as many times as the user entered.

    screenshot

  • Test your code. The password created should be the length entered by the user.

    screenshot