Oops, try again. Did you delete or rename movies?


#1



https://www.codecademy.com/courses/python-beginner-en-KAgt5/4/1?curriculum_id=4f89dab3d788890003000096


Oops, try again.
Did you delete or rename movies?
File "python", line 6
def printmovie:
^
SyntaxError: invalid syntax


print the key and value


movies = {
    "Monty Python and the Holy Grail": "Great",
    "Monty Python's Life of Brian": "Good",
    "Monty Python's Meaning of Life": "Okay"
}
def printmovie:
    print movies.each()
end


#2

have you recently been coding in ruby? the syntax suggest so. First, i don't understand why you use a function, no need, but if you do want to use a function, make sure to use the parentheses:

def example():
   pass

.each() doesn't exist in python, in ruby it might, not in python

end also doesn't exist in python.

uhm.. a function only execute when you call it, so you might need to add a function call


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.