What are the different kind of operators in Python? Explain each giving examples. could somebody pleasee answer it
Answers
Answered by
1
Answer:
Types of Operator
Python language supports the following types of operators.
Arithmetic Operators
Comparison (Relational) Operators
Assignment Operators
Logical Operators
Bitwise Operators
Membership Operators
Identity Operators
Answered by
12
➡ The different kind of operators in Python are :-
- Arithmetic operators :- Arithmetic operators are used with numeric values to perform common mathematical operations.
eg . (+) a+b
- Assignment operators :- Assignment operators are used to assign values to variables.
eg. (=) a = 4
- Comparison operators :- Comparison operators are used to compare two values .
eg. (<) a<b
- Logical operators :- Logical operators are used to combine conditional statements.
eg. (or) a<4 or a<5
- Identity operators :- Identity operators are used to compare the objects, not if they are equal, but if they are actually the same object, with the same memory location.
eg. (is) a is b
- Membership operators :- Membership operators are used to test if a sequence is presented in an object .
eg. (in) a in b
- Bitwise operators :- Bitwise operators are used to compare (binary) numbers:
eg. (~) not
____________________________________
Similar questions
Physics,
4 months ago
Math,
4 months ago
Social Sciences,
4 months ago
Physics,
8 months ago
Physics,
1 year ago