+ 4
What's the mistake
base = input('base=>') height = input('height=>') area = 1/2*base*height print(area)
3 Réponses
+ 4
# try this
base = float(input('base=>'))
height = float(input('height=>'))
area = (1/2)*base*height
print(area)
+ 3
try this
Base = int(input())
Height = int(input())
Area = 0.5*Base*Height
print(Area)
+ 2
The input return are strings
The 2 seems to multiplied by the base and height
Becuz the python does mutliplying first so your like
1/(2*base*height)
Try like SoloProg said or like GAURAV YADAV said they are both right