My Blog

My WordPress Blog

My Blog

My WordPress Blog

Python

Comments

Python Comments Python comments are programmer-readable explanation or annotations in the Python source code. They are added with the purpose of making the source code easier for humans to understand, and are ignored by Python interpreter. Comments enhance the readability of the code and help the programmers to understand the code very carefully. Example If […]

Python Operator Precedence

Python Operator Precedence An expression may have multiple operators to be evaluated. The operator precedence defines the order in which operators are evaluated. In other words, the order of operator evaluation is determined by the operator precedence. If a certain expression contains multiple operators, their order of evaluation is determined by the order of precedence. […]

Identity Operators

Python Identity Operators The identity operators compare the objects to determine whether they share the same memory and refer to the same object type (data type). Python provided two identity operators; we have listed them as follows: Python ‘is’ Operator The ‘is‘ operator evaluates to True if both the operand objects share the same memory […]

Python – Bitwise Operators

Python Bitwise Operators Python bitwise operators are normally used to perform bitwise operations on integer-type objects. However, instead of treating the object as a whole, it is treated as a string of bits. Different operations are done on each bit in the string. Python has six bitwise operators – &, |, ^, ~, << and >>. All these operators (except ~) […]

 Logical Operators

Python Logical Operators Python logical operators are used to form compound Boolean expressions. Each operand for these logical operators is itself a Boolean expression. For example, Example Along with the keyword False, Python interprets None, numeric zero of all types, and empty sequences (strings, tuples, lists), empty dictionaries, and empty sets as False. All other values are treated as True. […]

Comparison Operators

Python Comparison Operators Comparison operators in Python are very important in Python’s conditional statements (if, else and elif) and looping statements (while and for loops). The comparison operators also called relational operators. Some of the well known operators are “<” stands for less than, and “>” stands for greater than operator. Python uses two more operators, combining “=” symbol with these two. The “<=” symbol is for […]

Arithmetic Operators

Python Arithmetic Operators Python arithmetic operators are used to perform mathematical operations such as addition, subtraction, multiplication, division, and more on numbers. Arithmetic operators are binary operators in the sense they operate on two operands. Python fully supports mixed arithmetic. That is, the two operands can be of two different number types. In such a […]

Operators

Python Operators Python operators are special symbols used to perform specific operations on one or more operands. The variables, values, or expressions can be used as operands. For example, Python’s addition operator (+) is used to perform addition operations on two variables, values, or expressions. The following are some of the terms related to Python operators: Types of […]

Scroll to top