My question is why is sleep() returning a syntax error sleep is being imported from time. So I should be able to just do sleep(s) where s = numeric value in seconds. I tried writing the the object out completely time.sleep() still returns the same syntax error. I'm pretty sure that this is correct. It even provides you then exact information to input within the project. Can someone assist me? Is it a bug within this project?
""" This is a calculator app. We will let user pick a shape and then calculate the are of the shape chosen """
from math import pi
from time import sleep
from datetime import datetime
now = datetime.now()
print('calculator simulator now simulating')
print("current time: %s/%s/%s/%s:%s" %(now.month.now.day,now.year,now.hour,now.minute)
hint = "Do not 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 radius:'))
area = pi*radius**2
print('The pie is baking')
print("Area: %.2f. \n%s" %(area, hint))
elif option == 'T': base = float(raw_input("enter value of base:")) height = float(raw_input("Enter height of triangle:")) area = .5*b*h print("Uni Bi Tri...") sleep(1) print("Area: %.2f \n%s" %(area,hint))