-1
每当我在使用的时候包有问题,我得到这个错误:即时通讯使用的时间包
Traceback (most recent call last):
File "C:\Python34\2015\intrest calculator.py", line 53, in <module>
time.sleep(1)
AttributeError: 'float' object has no attribute 'sleep'
这里是我的代码:
import time
while True:
choice = input("will you like to calculate simple or compound intrest:")
if choice == "simple intrest":
userData(choice)
time = time/12
intrest = principal * time * intrestRate
intrest = round(intrest, 2)
balance = principal + intrest
balance = round(balance, 2)
balance = str(balance)
intrest = str(intrest)
print("your intrest is: %" + intrest)
time.sleep(1)
print("your final balance is $" + balance)