Ask coding questions

← Back to all posts
rovertb (0)

what is missing from my code?

ThomasS1 (58)

The others are right that you were missing a colon at the end of line 1, but you also have another problem: input cannot be used as a variable name as it is a reserved function name. You can change lines 5-9 to this:

base = float(input("enter base: "))
height = float(input("enter height:"))

and it should then work.

joshhies (193)

next time try reading the er. You can see the invalid syntax at line 1 of the script.

You are missing a colon.

Upvote and mark this answer as Answer if you like this answer.

mwilki7 (944)

i believe you're missing a colon

def area_of_triangle(base, height):