main () - это неверный синтаксис? - PullRequest
0 голосов
/ 22 января 2020

Я использую main () для запуска программы, но она продолжает называть ее неверным синтаксисом. Кажется, что даже отладчик не может сделать из этого ни головы, ни хвоста. Вот мой общий код.

     """

  InvestmentCalculator.py helps generate how much interest one earns after a certain period of time
 """


 def main():
     total_money = 0
     months_invested = 0
     years_investment = 0

 investment = float(input("How much would you like to invest? "))
 years_investment = float(input("How many years would you like to invest? "))
 interest_rate = float(input("What is the interest rate? "))
 total_money = float()

 months_invested = years_investment / 12
 while months_invested > 0:
     total_money = investment +  total_money
     months_invested = months_invested - 1
     print("You have earned ${:,.2f}".format(total_money))
 else: print("You've earned a total of ${:,.2f}".format(total_money)



 main()

1 Ответ

2 голосов
/ 22 января 2020

Это ошибка синтаксиса. Вы пропустили скобки для выписки на печать line: 18

enter image description here

...