ajithkp560

Area Calculator

May 11th, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. print "Select shape:"
  2. print "1 rectangle"
  3. print "2 Circle"
  4. print "3 Triangle"
  5. shape=input("> ")
  6. if shape==1:
  7.     l=input("Length:")
  8.     b=input("breadth:")
  9.     area=l*b
  10.     print "The area of rectangle is", area
  11. if shape==2:
  12.     r=input("radius:")
  13.     area=3.14*r*r
  14.     print "The area of circle is", area
  15. if shape==3:
  16.     b=input("b:")
  17.     h=input("h:")
  18.     area=0.5*b*h
  19.     print "The area of Triangle is", area
Advertisement
Add Comment
Please, Sign In to add comment