-
-
Save codecademydev/895527a415781d67d6f0dd20b9810d3e to your computer and use it in GitHub Desktop.
Codecademy export
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
"""you will choose a shape, then it will calculate the area of the chosen shape, have fun.""" | |
from math import pi | |
from time import sleep | |
from datetime import datetime | |
now = datetime.now() | |
print "calculater well start up :)" | |
print " current time: %s/%s/%s %s:$s"% (now.month, now.day, now.year, | |
now.hour, now.minute) | |
sleep(1) | |
hint = "Dont forget to include the correct units! \nExiting...." | |
option = raw_input("Enter C for cirlce or T for triangle: ") | |
option = option.upper | |
if option == "C": | |
radius = float(raw_input("Enter radius: ")) | |
area = pi * radius ** 2.0 | |
print "The pie is baking...." | |
sleep(3) | |
print ("area: %.2f. \n%s" % (area, hint) | |
elif option == "T": | |
base = float(raw_input("Enter base: ")) | |
heigth = float(raw_input("Enter heigth: ")) | |
area = (base * heigth) / 2.0 | |
print "Please wait im calculating SIR, im not as smart as you think!" | |
sleep(3) | |
print ("area: %.2f. \n%s" % (area) | |
else: | |
print "PLEASE DONT WASTE MY TIME \n Goodbye:)" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment