000001 Lecture Notes - Bitwise Operation, Operand, Exponentiation

9 views4 pages
20 Mar 2023
Department
Course
Professor

Document Summary

Operators are special symbols that perform some operation on operands and returns the result. Python includes the operator module that includes underlying methods for each operator. Python includes the following categories of operators: arithmetic operators, assignment operators, comparison operators, membership test operators, bitwise operators. Exponentiation: left operand raised to the power of right. Floor division: equivilant to math. floor(a/b: comparison operators: The comparison operators compare two operands and return a boolean either true or false. The following table lists comparison operators in python. True if the left operand is higher than the right one. >>> x = 5; y = 6 >>> x > y false. True if the left operand is lower than right one. True if the left operand is higher than or equal to the right one. True if the left operand is lower than or equal to the right one. Returns true if an expression evalutes to false and vice-versa.