0
Why will this not work
import random def get_questions(): questionBank = [] questionBank.append(["how many steps are in the eiffel tower?", "1770", "10838"]) questionBank.append(["how many different flavours of gummy bears are there?", "4", "5"]) questionBank.append(["how many pizzas are eaten in the US per year?", "3 billion", "1,5 million"]) return questionBank def play_Quiz(): get_questions() = questions random.shuffle(questions) score = 0 for s in questions: print(s[0] + s[1] "or" s[2]) If you try to run it will say that it expected an indented block, someone help please
2 Antworten
+ 4
The error gives yoy everything you need. Line 24 is not indented. Therefore you need to tab line 24. Every line you want to be in a for loop must be indented one tab past its indent
0
def play_Quiz():
# get_questions() = questions
# flipped from original line above
questions = get_questions()
random.shuffle(questions)
score = 0
for s in questions:
# indent & use commas, not '+'
print(s[0], s[1], "or", s[2])
play_Quiz() # need to call play_Quiz