vendredi 23 janvier 2015

Take a list and make it into strings

Basically I'm trying to make a random word generator but I want to be able to copy and paste the words into python and then have it change each word into a string so I can randomly choose.


The code I'm going to use is similar to this:



import random
a = ["Cat", "DOG", "MOM"]
print(random.choice(a))


I'm a python newbie, so if there is an easier way to make a random word generator let me know. Its going to have two generators, one for verbs and one for nouns.





Aucun commentaire:

Enregistrer un commentaire