Update README.md

Signed-off-by: David Rotermund <54365609+davrot@users.noreply.github.com>
This commit is contained in:
David Rotermund 2023-12-06 23:18:39 +01:00 committed by GitHub
parent 1c31956058
commit 9a79946beb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,6 +64,9 @@ Order of operations:
|-x|x negated| |-x|x negated|
|+x|x unchanged| |+x|x unchanged|
|Operator|Description| |Operator|Description|
|---|---| |---|---|
|abs(x)|absolute value or magnitude of x| |abs(x)|absolute value or magnitude of x|
@ -90,6 +93,24 @@ print(5 // 2) # -> 2
print(6 // 2) # -> 3 print(6 // 2) # -> 3
``` ```
## Inplace Operation
|Inplace Operation|Short for|
|---|---|
|a += b| a = a + b|
|a &= b| a = a & b |
|a //= b|a = a // b|
|a <<= b| a = a << b|
|a %= b| a = a % b|
|a *= b| a = a * b|
|a @= b| a = a @ b|
|a \|= b| a = a \| b|
|a **= b| a = a ** b|
|a >>= b| a = a >> b|
|a -= b| a = a - b|
|a /= b| a = a / b|
|a ^= b| a = a ^ b|
## [Boolean Operations — and, or, not](https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not) ## [Boolean Operations — and, or, not](https://docs.python.org/3/library/stdtypes.html#boolean-operations-and-or-not)
|Operation|Result| |Operation|Result|
@ -250,6 +271,24 @@ These are the ["Mapping Operators to Functions"](https://docs.python.org/3/libra
|Ordering|a >= b|ge(a, b)| |Ordering|a >= b|ge(a, b)|
|Ordering|a > b|gt(a, b)| |Ordering|a > b|gt(a, b)|
[In-place Operators](https://docs.python.org/3/library/operator.html#in-place-operators)
|||
|---|---|
|a += b| a = iadd(a, b)|
|a &= b| a = iand(a, b) |
|a += b for a and b **sequences**| a = iconcat(a, b)|
|a //= b|a = ifloordiv(a, b)|
|a <<= b| a = ilshift(a, b)|
|a %= b| a = imod(a, b)|
|a *= b| a = imul(a, b)|
|a @= b| a = imatmul(a, b)|
|a \|= b| a = ior(a, b)|
|a **= b| a = ipow(a, b)|
|a >>= b| a = irshift(a, b)|
|a -= b| a = isub(a, b)|
|a /= b| a = itruediv(a, b)|
|a ^= b| a = ixor(a, b)|