All Operators in Python - #Single code
All Operators in Python - #Single code:
The single python code consists of all operators used in python (Fundamental):
Sample Output for All operators
PS C:\Users\Bharani\OneDrive\Desktop\Python Workspace> & C:/Users/Bharani/AppData/Local/Programs/Python/Python39/python.exe "c:/Users/Bharani/OneDrive/Desktop/Python Workspace/ALLOPERATORS.py" Enter the two values5 2
Arithmetic Operators
The addition of two numbers is: 7 The Subtraction of two numbers is: 3 The Multiplication of two numbers is: 10 The Division of two numbers is: 2.5 The Modulus of two numbers is: 2
Relational Operators
The value of a is greater than b The value of a is greater than or equal to than b
logical Operators
False True False
Bitwise Operator
The bitwise AND operator of two values is: 0 The bitwise OR operator of two values is: 7 The bitwise NOT operator of two values is: -6 The bitwise XOR operator of two values is: 7 The bitwise Right shift o operator of two values is: 1 The bitwise left shift operator of two values is: 20
Identity Operators
False True False
Membership Operator
True True False True False
Operator Precedence
610 Hello! Welcome.
Operator Associativity
100.0 6 0 512
Ternary Operator
2 2 2 2 a is greater than b
Conditional in Ternaray operator
2
"//" for integers
2 -3
concatenate two strings
Operatorsin Python
Repeat the String
All operators All operators All operators All operators
Any All in Python
False True True The true division of numbers is : 2.5 The floor division of numbers is : 2 The exponentiation of numbers is : 25 The modulus of numbers is : 1 The original list is : 1 5 6 7 8 The modified list after setitem() is : 1 5 6 3 8 The modified list after delitem() is : 1 6 3 8 The 4th element of list is : 8
Overlapping operators
not overlapping
Source Code: github.com/Bharanidharan S
Comments
Post a Comment