all letters an numbers py array 1

all letters an numbers py array

randomChar = ['a', 'A', 'b', 'B', 'c', 'C', 'd', 'D', 'e', 'E', 'f', 'F',
              'g', 'G', 'h', 'H', 'i', 'I', 'j', 'J', 'k', 'K', 'l', 'L',
              'm', 'M', 'n', 'N', 'o', 'O', 'p', 'P', 'q', 'Q', 'r', 'R',
              's', 'S', 't', 't', 'T', 'u', 'U', 'v', 'V', 'w', 'W', 'x',
              'X', 'y', 'Y', 'z', 'Z', '1', '2', '3' , '4', '5', '6', '7',
              '8', '9']

Here is what the above code is Doing:
1. We are creating a list of all the characters that we want to use in our password.
2. We are creating a variable called ‘password’ and setting it to an empty string.
3. We are creating a variable called ‘randomChar’ and setting it to an empty list.
4. We are creating a for loop that will run for the number of times that the user wants their password to be.
5. We are creating a variable called ‘randomNumber’ and setting it to a random number between 0 and the length of the list of characters.
6. We are appending the character at the random number to the list of random characters.
7. We are joining the list of random characters to the empty string.
8. We are printing the password.

Similar Posts