Ask coding questions

← Back to all posts
badcode
rovertb (0)

https://repl.it/@rovertb/badcode

what is missing from my code?

Commentshotnewtop
joshhies (155)

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.

ThomasS1 (54)

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.

mwilki7 (283)

i believe you're missing a colon

def area_of_triangle(base, height):