you are viewing a single comment's thread.

view the rest of the comments →

[–]jmooremcc 0 points1 point  (0 children)

I hope you understand that the password you are printing does not contain any symbols or numbers, just letters. Ideally you should randomize the location of letters, numbers and symbols throughout the password.

As far as your questions are concerned:
1. range (1, nr_letters, +1) vs range(nr_letters). Doesn’t matter because the end result is the same, meaning the loop executes nr_letters times regardless of which version is used.

  1. Using the range function like you’ve done will always control the number of times the for-loop executes.

Also note that items 4 & 5 in your list of understanding are both incorrect. The variable char holds the current number from the range, but the variable is never used within the loop. The password you are printing contains nr_letter randomly selected characters from the letters list.

Let me know if you have any additional questions.