Python Shorthand Operator?

后端 未结 3 382
终归单人心
终归单人心 2020-12-11 21:09

I was researching some information on the topic of trial division, and I came across this symbol in Python:

//=

I got this from here where

3条回答
  •  暖寄归人
    2020-12-11 21:26

    // is integer division and the

    n //= p
    

    syntax is short for

    n = n // p
    

    except the value n is modified directly if it supports this.

提交回复
热议问题