Python Dates and Times in Python Let's Build a Timed Quiz App The Quiz Class

indentation 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
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Oszkár Fehér
Treehouse Project Reviewer

Salam 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

Hi Oszkar,

Thanks, I apppreciate the help.