Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created May 6, 2017 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/895527a415781d67d6f0dd20b9810d3e to your computer and use it in GitHub Desktop.
Save codecademydev/895527a415781d67d6f0dd20b9810d3e to your computer and use it in GitHub Desktop.
Codecademy export
"""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