Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Area calculation program - yes this was out of a example
- print "Welcome to the Area/volume calculation program"
- print "---------------------------------------"
- print
- # display the first menu
- print "Make your selection now!"
- print "1 Flat"
- print "2 Volumetric"
- selection = input("> ")
- # display options for flat objects
- if selection == 1:
- print "Please select a shape:"
- print "1 Rectangle"
- print "2 Circle"
- print "3 Square"
- shape = input("> ")
- # calculate their areas
- if shape == 1:
- height = input("Please enter the height: ")
- width = input("Please enter the width: ")
- area = height*width
- print "The area is", area
- elif shape == 2:
- radius = input("Please enter the radius: ")
- area = 3.14*(radius**2)
- print "The area is", area
- else:
- side = input("Please enter the side: ")
- area = side**2
- print "The area is", area
- # display options for volumetric objects
- elif selection == 2:
- print "Please select a shape:"
- print "1 Cube"
- print "2 Sphere"
- shape = input("> ")
- # calculate their volumes
- if shape == 1:
- side = input("Please enter the side: ")
- volume = side**3
- print "The volume is", volume
- elif shape == 2:
- radius = input("Please enter the radius: ")
- volume = (4*3.14*(radius**3))/3
- print "The volume is", volume
- else:
- print "Please enter either '1' or '2'"
- # a little easter egg
- elif selection == 52:
- print "Are you really sure you want to play The Cheetahmen?"
- print "1 Yes!!!!!"
- print "2 No"
- insane = input("> ")
- if insane == 1:
- print "Are you crazy??????????"
- elif insane == 2:
- print "Okay"
- else:
- print "Please choose either '1' or '2'"
- else:
- print "Please choose either 1 or 2" # ;)
Add Comment
Please, Sign In to add comment