jeudi 25 février 2016

PYTHON randomize questions from a list and enumerate

I'd like to make

you.questions=['Finish this poem "Roses are red Violets are ..."','What is your favorite food?','Stones or Beatles?','favorite pet?','favorite color?','favorite food?']
for q in xrange(3)
    question = ''
    while question not in questions:

(this is where I'm stuck)

into

  1. What is your favorite food?
  2. favorite pet?
  3. Stones or Beatles?

the end result will be 7 questions from a pool of 25. Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire