Python- Returns

I am working on this exercise, and I keep getting an error but the lesson says I am correct.

This is my code:

def calculate_age(current_year, birth_year):
  age = current_year - birth_year
  return age

my_age = calculate_age(2049, 1993)
dads_age = calculate_age(2049, 1953)

print("I am " + str(my_age) " years old and my dad is " + str(dads_age) + " years old. ")

This is the error:

  File "script.py", line 8
    print("I am " + str(my_age) " years old and my dad is " + str(dads_age) + " years old. ")
                                                          ^
SyntaxError: invalid syntax

Can someone help?

    "I am " + str(my_age) + "
                          ^

Insert the missing token and the syntax will be correct.

3 Likes

Ok I see the problem now! Thank you!

2 Likes

5 posts were split to a new topic: Why does modulo return None rather than 0?