dimanche 26 août 2018

Python | 26 lists called a-z, string with every letter, random letter is choosen, how to select the list

I have 26 lists called a,b,c,..,z and a string called letters.

letters = "abcdefghijklmnopqrstuvwxyz"

Now I randomly choose a letter out of that string.

start_letter = random.choice(letters)

The value of start_letter should now be one letter, which is a list in my script. Now, how do I select that list and randomly choose a "slot" in that list?




Aucun commentaire:

Enregistrer un commentaire