Sleep(1) isn't working


#1

sleep(1) keeps creating an error. how to fix??


#this is a calculator lol
from math import pi
from time import sleep
from datetime import datetime
now = datetime.now()
print("Starting!")
print("Current time: %s/%s/%s %s:%s" % (now.month, now.day, now.year, now.hour, now.minute)
sleep(1)      
hint = "Don't forget to include the correct units! \nExiting..."
option = raw_input("Enter C for Circle or T for Triangle: ")
option = option.upper()
if option == "C":
      radius = float(raw_input("Enter a radius: "))
      area = pi * radius**2
      print("The pie is baking...")
      sleep(1)
      print ("Area: %.2f. \n%s" % (area, hint))
elif option == "T":
      base = float(raw_input("Enter the base of the triangle: "))
      height = float(raw_input("Enter the height of the triange: "))
      area = (0.5)*base*height
      print("Uni Bi Tri...")
      sleep(1)
      print ("Area: %.2f. \n%s" % (area, hint))
else:
      print("Error! Invalid shape selector specified. Exiting.")


#2

Hi @greatglutengoods,

The line prior to the first occurrence of ...

sleep(1)

... has an unclosed parenthesis.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.