Tuesday, 6 March 2012

Python programme read three inputs from user and show whether or not they are a Pythagorean triple or right angle traingle


#Pythagoras theorem
# a*a + b*b = c*c
#Show input are pythgorean triple or not


-def PythaGorean(a,b,c):
    x=a*a+b*b
    y=c*c
    if (x==y) :
        print 'It is a right angle traingle or Pythagorean triple'
    else:
        print 'It is not a right angle traingle'


 -def ReadValues():
 
  per=input("Enter the value of perpendicular:-")
    base=input("Enter the value of base:-")
    hypo=input("Enter the value of Hypotenuse:-")
    PythaGorean(per,base,hypo)
-def main():
    ReadValues()
main()  

No comments:

Post a Comment

Compiler for C,C++ and Python {paste your programme to see the output}