我不断收到语法错误,但我不知道为什么[关闭]

问题描述 投票:0回答:1
while True:

    x = float(input("how much money are you investing?: "))
    y = float(input("whats the percantage of your earning: "))
    year = int(input('how many years would you like to see: '))

    cycle = 0
    while cycle != year:
        income = float('what is your earning for year {}: '.format(cycle))
        year_earning = x + return_earning(x, y)
        x += (year_earning + wage_investment(income)
        cycle += 1
        print('year{}: {}'.format(cycle, year_earning))


错误指向循环+ =1。我试图做的是,每次执行while循环时,循环将从0更新为1到2,依此类推

我没有包括诸如return_ earning()或工资_investment()之类的某些功能,因为它似乎与我不断得到的错误无关,

我该如何修复它以及为什么它不想更新

python while-loop syntax syntax-error
1个回答
1
投票

您缺少右括号

x += (year_earning + wage_investment(income))

© www.soinside.com 2019 - 2024. All rights reserved.