Category: Basic

  • 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…

  • Membership Operators

    Python Membership Operators The membership operators in Python help us determine whether an item is present in a given container type object, or in other words, whether an item is a member of the given container type object. Types of Python Membership Operators Python has two membership operators: in and not in. Both return a Boolean result. The…

  • 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 age >16and marks >80 percentage <50or attendance <75 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…

  • Assignment Operators

    Python Assignment Operator The = (equal to) symbol is defined as assignment operator in Python. The value of Python expression on its right is assigned to a single variable on its left. The = symbol as in programming in general (and Python in particular) should not be confused with its usage in Mathematics, where it states that…

  • 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…

  • Literals

    What are Python Literals? Python literals or constants are the notation for representing a fixed value in source code. In contrast to variables, literals (123, 4.3, “Hello”) are static values or you can say constants which do not change throughout the operation of the program or application. For example, in the following assignment statement. x =10…

  • Unicode System

    What is Unicode System? Software applications often require to display messages output in a variety in different languages such as in English, French, Japanese, Hebrew, or Hindi. Python’s string type uses the Unicode Standard for representing characters. It makes the program possible to work with all these different possible characters. A character is the smallest possible component…