2015-04-18 75 views
-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) 

回答

0

對不起你們,只是想出了我的錯誤。

對於有同樣問題的其他人,確保你的變量沒有任何與你的軟件包相同。

對不起,這是我的壞。

應該看到從一開始