imDarshanGK / Operators

operators

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Arithmetic operators

An arithmetic operator is a mathematical function that performs a calculation on two operands

solution:

Arithmetic operators

Add = 77
Sub = 13
Mul = 1440
Div = 1.40625
Mod = 13
Exp = 79946681398258369524447459012293256819248199462890625
F.D = 1

Left shift

40

Bitwise NOT(~)

-11
 9

Bitwise-OR

Bitwise OR

solution

236

logical operators

There are used to compare two relational expressions, after comparison it gives True or False.

True
False
False
False
True
True
True
False
False
True

Assignment Operators

In fix which are used to perform operations on variables or operands and assign values to the operand on the leftside of the operator.

a= 40
a+= 80
a-= 40
a*= 1600
a/= 40.0
a%= 0.0
a//= 0.0

Relational operators

It is used to compare the two operands and it returns true or false.

True
False
True
False
True
True
False

Right shift and Left shift

Right shift and Left shift

1} Bitwise Right Shift Operator

The bitwise right shift operator in python shifts the bits of the binary representation of the input number to the right side by a specified number of places. The empty bits created by shifting the bits 
are filled by 0s. 

2} Bitwise Left Shift Operator

The bitwise left shift operator in Python shifts the bits of the binary representation of the input number to the left side by a specified number of places. The empty bits created by shifting the bits 
are filled by 0s.  

Right shift

Right shift is: 1

Left shift

Left shift is: 48