Python: How do I add variables with integer values together?

前端 未结 3 1016
无人共我
无人共我 2021-01-14 13:15

I\'m new to Python. How do I add variables with integer values together?

balance = 1000
deposit = 50
balance + deposit
print \"Balance: \" + str(balance)
         


        
3条回答
  •  误落风尘
    2021-01-14 13:37

    you need to use the assignment operator: balance = balance + deposit OR balance += deposit

提交回复
热议问题