+ 3
Please Correct error of this code
Line 12 Syntex error https://code.sololearn.com/cmpe9bXL81HL/?ref=app
3 Antworten
+ 2
Can You tell me what was my mistake Granger
Thank you Soooooooo Much bro
0
The indentation was not proper check from here:-
#code to determine elements of pythaghoras theorem
def hypotenus(p,b):
return p**2+b**2
def perpendicular(a,c):
return a**2-c**2
def base(x,z):
return x**2-z**2
x=float(input(' type 1 to find hypotenus \n type 2 to find perpendicular \n type 3 to find base '))
if x==1:
p=float(input('\n Enter perpendicular'))
b=float(input('\n enter base'))
print('\n hypotenus is',hypotenus(p,b))
elif x==2:
a=float(input('\n Enter hypotenus'))
c=float(input('\n enter base'))
print('\n perpendicular is',perpendicular (a,c))
elif x==3:
x=float(input('\n Enter hypotenus'))
z=float(input('\n Enter perpendicular'))
print('\n base is',base (x,z))
else:
print ("bye")
P.S. The result isn't the hypotenuse, base or perpendicular but it's square, you may change the code accordingly.
Thank you.