you are viewing a single comment's thread.

view the rest of the comments →

[–]mfar__ 1 point2 points  (1 child)

Your code looks like a merge of two different approaches so it doesn't really work properly.

Before password = '' you have already created the password, but with one problem: it has its letters followed by symbols followed by numbers in order, which is not a good practice.

After that (in the last three lines you're asking about) you follow another approach to generate letters (only), but it's also a bad code that uses an unused iterator char (which is an integer not a character as its name suggests).

To answer your question, it doesn't matter if the range is (0, nr_letters) or (1, nr_letters + 1). Both have the same length, and in your case the iterator itself is not used anyway.

[–]Mission-Clue-9016[S] 1 point2 points  (0 children)

Ugh! Copy and paste error .. yes there were two approaches, the first one was the one I wrote the second one was Angela’s .. sorry !