mercredi 7 décembre 2016

Trying to call a function assigned to a variable randomly chosen from a list

Ok, so basically i am assigning some functions to some similarly named variables and then creating a list that includes all of those variables. I then am choosing a variable randomly from the list and removing it, then soon after trying to call the function that is assigned to the variable...

But this code does not work, so any help please?

Question1 = QuestionOne
Question2 = QuestionTwo
Question3 = QuestionThree
Question4 = QuestionFour
Question5 = QuestionFive

Questions = (Question1, Question2, Question3, Question4, Question5)

RandQuestion = random.choice(Questions)

Questions.delete(RandQuestion)

RandQuestion()




Aucun commentaire:

Enregistrer un commentaire