h = float(input( “Enter the height of the triangle:”)
b = float(input( " Enter the base of the triangle:")
area = (1/2bh)
print(" The area is:", area)
This is a decent base.
What error did you get? I’m expecting SyntaxError: unexpected EOF while parsing
, but it will also show you a pointer (a ^
character) pointing to where it encountered the error. If you try again using Python 3.10 it will actually tell you SyntaxError: '(' was never closed
and show you which one wasn’t closed.
If your error was something else, do please tell us
Also, a tip for using forums like this one: use a set of triple backticks (```
) on its own line before and after your code block to make it nicely formatted. For example, in what you posted I see area = (1/2bh)
with an italicized b
, but I expect what you actually had there was area = (1/2*b*h)
.
Thanks … it worked … i didn’t close ‘(’