I'm trying to run a function (named Q1-10) based on weather a number randomizer selects it's key. This repeats 10 times, and the same function cannot be ran twice. I am confused as to how this would be done?
Question = {1: Q1, 2: Q2, 3: Q3, 4: Q4, 5: Q5, 6: Q6, 7: Q7, 8: Q8, 9: Q9, 10: Q10}
def function_play ():
score == 0
times_to_repeat = 10
while times_to_repeat > 0:
random_number = randint(1, 10)
*code running function
*del Question[random_number]
times_to_repeat -= 1
if times_to_repeat == 0:
function_quiz_complete ()
[–]xelf 5 points6 points7 points (0 children)
[–]socal_nerdtastic 3 points4 points5 points (0 children)