Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMohammad Aslam
6,053 Pointsindentation error when I try to run Quiz
Hi there,
I am getting a weird error when I try to run Quiz. The indentation is fine but it is still giving an error.
from quiz import Quiz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/treehouse/workspace/quiz.py", line 28
def ask(self, question):
^
IndentationError: expected an indented block
def take_quiz(self):
# log the start time
# ask all of the questions
# log if they got the question right
# log the end time
# show a summary
def ask(self, question): (!!!!!! line 28)
# log the start time
# capture the answer
# check the answer
# log the end time
# if the answer's right, send back True
# otherwise, send back False
# send back the elapsed time, too
Thanks, Omer
2 Answers
Oszkár Fehér
Treehouse Project ReviewerSalam Mohammad. If your functions are just what you showed than it will be an error because nothing is passed in the function, the comments are not part of the script, if you write under the:
def ask(args):
pass
it will work. I hope this will help you out. Happy coding
Mohammad Aslam
6,053 PointsHi Oszkar,
Thanks, I apppreciate the help.