-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)