Created
March 8, 2013 19:04
-
-
Save chyyran/5118939 to your computer and use it in GitHub Desktop.
calc.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def calc_rectangular_prism(sidea, sideb, sidec,unit="cm"): | |
volume = sidea*sideb*sidec | |
area = sidea * sideb + sideb * sidec + sidea * sidec | |
area = 2 * area | |
print "a = 2(lw+lh+wh)" | |
print " = 2(%sx%s+%sx%s+%sx%s)" % (str(sidea),str(sideb),str(sidea),str(sidec),str(sideb),str(sidec)) | |
print " = 2(%s+%s+%s)" % (str(sidea * sideb),str(sidea*sidec),str(sideb*sidec)) | |
print " = 2(%s)" % str(area/2) | |
print " = %s %s squared" % (str(area),unit) | |
print "Volume = %s %s cubed" % (str(volume),unit) | |
print "Area = %s %s squared" % (str(area),unit) | |
print "Can I please have my food rations now?" | |
string = raw_input() | |
if string.lower() == "no": | |
print "Sorry for bothering you, Glorious Leader" | |
return | |
print "I am forever grateful, Glorious Leader" | |
calc_rectangular_prism(15,12,16) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment