Posts

Showing posts from February, 2021

Python Comparison Operators

Image
Python Comparison Operators Comparison operators are used to compare two values. these are easy and simple to understand as they return the  boolean value. i.e. True or false. Comparison operators are also known as the relational operators . Operators Description Syntax == Equal to : True if both operands are equal. a == b != Not equal : True if both operands are unequal. a != b >   Greater than : True if 1 st operand is greater than 2 nd operand. a > b < Less than : True if 1 st operand is less than 2 nd operand. a < b >= Greater than or equal to : True if 1 st operand is greater than or equal to 2 nd  operand. a >= b <= Less than or equal to : True if 1 st operand is less than or equal to 2 nd operand. a <= b ...

Assignment Operators in Python

Image
Assignment Operators in Python   Assignment operators : Assignment operators are used to assign the value to the variable. Operators Description Syntax = Is used to assign value to the variable. a = 5 += Add left operand to right operand and assign value to left operand. b += a -= Subtract right operand from left operand and assign value to left operand. b -= a *= Multiply left operands with right operands and assign value to left operand. b *= a /= Divide left operand by right operand and assign value to left operand. b /= a **= Calculate power of left operand to right operand and assign value to left operand. b **= a //= It perform floor division as it divide left operand by right operand , it return the value of quotient and a...

Arithmetic Operators in Python

Image
  Arithmetic Operators in Python Python programming has collection of operators to perform various operations.an operators is a symbols which operates on value or variables. Arithmetic Operator     : Arithmetic operators are the binary operators. Arithmetic operators are used to perform mathematical operations. Addition , Subtraction ,Multiplication ,Division are the basic operation performed by the arithmetic operators. Operator Name Syntax + Addition : Use to add two operands X + Y - Subtraction: Use to subtracts two operands. X – Y * Multiplication : Use to multiply two operands. X * Y / Division : Use to divide two operands. X / Y % Modulus : Use to returns the value of remainder after dividing two operands. X % Y ** Exponentiation (power) : Use for calculating...