Bitwise Operators are only applicable for int and boolean data type. If we try to apply for any other type then we will get error.The Bitwise Operator are &, |, [ … ]
Category: Python
Logical Operator
Logical Operators are and, or, not For Boolean Types: and ==> If both arguments are True then the result is True or ==>If one argument is True then the result [ … ]
Relational Operators
These operators are used to check the relation between two input values such as <,=,>,<=,>=. The result will be given in boolean type or bool. Example 1: a=10 b=20 print(“a<b [ … ]
Arithmetic Operators
Arithmetic Operators are the operators which perform arithmetic operations like, +==>Addition -==>Subtraction *==>Multiplication /==>Division %==>Modulo //==>Floor Division Operator **==>Exponent Or Power Operator Example: a=20 b=4 print(‘a+b=’,a+b) print(‘a-b=’,a-b) print(‘a*b=’,a*b) print(‘a/b=’,a/b) print(‘a//b=’,a//b) [ … ]
Operators
Operator is a symbol that perform certain operations. Python provides certain operators Arithmetic Operators Relational Operators Or Comparison Operators Logical Operators Bitwise Operators Assignment Operators Special Operators
Constants
Constants concept is not applicable in Python. But only upper case characters are used if we don’t want to change values. MAX_VALUE=10 It is convenient but we can change the [ … ]
Escape Character
In String literals we can use escape characters to associate a special meaning. The following are various important escape characters in Python \n==>New Line \t==>Horizontal Tab \r==>Carriage Return \b==>Back Space [ … ]
None Data Type
None means Nothing or No value associated. If no values are available then None Data type is used. It is like null value in java. Example: def m1(): a=10 print(m(1)) [ … ]
dict Data Type:
To represent group of values as key value pairs dict data type is used. Example: d={101:”Rahul’,201:’Raju’,301:’Rakesh’} Duplicate keys are not allowed but values can be duplicated. If we are trying [ … ]
frozenset Data Type
It is same as set except that is is immutable. So, we cannot use add or remove functions. 1.>>>a={5,10,15,20} >>>fs=frozenset(a) >>>type(fs) <class ‘frozenset’> >>>fs frozenset({20,10,5,15}) >>>for i in fs:print(i) ………. [ … ]