Python expressions and operators 19
1. Expression operators commonly used in python 1. arithmetic Operations x * y, x/y, x/y, x % y x + y, x-y 2. logical operation: x or y, x and y, not x 3. member relationship calculation: x in y, x not in y 4. object instance test: x is y, x not is y 5. comparison: x <y, x> y, x <= y, x> = y, x = y, x! = Y 6. bitwise operation: x | y, x & y, x ^ y, x <y, x> y 7. unary operation:-x, + x ,~ X (bitwise inversion) 8. power Operation: x ** y 9. indexes and shards: x [I], x [I: j], x [I: j: stride] 10. call operation: x (...) 11. property: x. attribute 12. tuples :(...) 13. sequence: [...] 14. dictionary :{...} 15. ternary selection expression: x if y else z 16. anonymous function: lambda args: expression 17. generator function sending protocol: yield x 2, computing priority, from high to low (...), [...], {...} s [I], s [I: j] s. attribute s (...), function call + x,-x ,~ X ** y *,/, //, % +,-<, >>&^| <, <=, >,>= ,! = Is, not is in, not in not and or lambda