^=, -= and += symbols in Python

前端 未结 2 1426
长情又很酷
长情又很酷 2021-02-01 06:51

I am quite experienced with Python, but recently, when I was looking at the solutions for the codility sample tests I encountered the operators -=, +=,

2条回答
  •  终归单人心
    2021-02-01 07:01

    As almost any modern language, python has Assignment Operators so they can use them every time you want to assign a value to a variable after doing some arithmetic or logical operation, both (assignment and operation)are expressed compact way in one statement....

提交回复
热议问题