![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 27104 Articles for Server Side Programming
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/7345/profile/60_93814-1511173378.jpg)
286 Views
In Python, is and is not operators are called identity operators. Each object in computer's memory is assigned a unique identification number (id) by Python interpreter. Identity operators check if id() of two objects is same. 'is not' operator returns true of id() values are different and false if they are same.>>> a=10 >>> b=a >>> id(a), id(b) (490067904, 490067904) >>> a is not b False >>> a=10 >>> b=20 >>> id(a), id(b) (490067904, 490068064) >>> a is not b True
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/7345/profile/60_93814-1511173378.jpg)
2K+ Views
In Python, is and is not operators are called identity operators. Each object in computer's memory is assigned a unique identification number (id) by Python interpreter. Identity operators check if id() of two objects is same. 'is' operator returns false of id() values are different and true if they are same.>>> a=10 >>> b=a >>> id(a), id(b) (490067904, 490067904) >>> a is b True >>> a=10 >>> b=20 >>> id(a), id(b) (490067904, 490068064) >>> a is b False
![Gireesha Devara](https://www.tutorialspoint.com/assets/profiles/397483/profile/60_1063327-1637125522.jpg)
2K+ Views
In some languages like C / C++ the "!" symbol is used as a logical NOT operator. !x it returns true if x is false else returns false. The equivalent of this "!" operator in python is logical NOT, It also returns true if the operand is false and vice versa. Example In the Following example the variable operand_X holds a boolean value True, after applying the not operator it returns False. operand_X = True print("Input: ", operand_X) result = not(operand_X) print('Result: ', result) Output Input: True Result: False Example For False value the ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/7345/profile/60_93814-1511173378.jpg)
235 Views
In Python ** is a raised to operator. It returns x raised to y in the expression x**y>>> x=5 >>> y=3 >>> x**y 125^ is a bitwise XOR operator. Taking two bits as operands it returns 1 if one is 1 and other is 0>>> a=10 >>> bin(a) #0001 1010 '0b1010' >>> b=20 >>> bin(b) #0010 0100 '0b10100' >>> c=a^b >>> c 30 >>> bin(c) #0011 1110 '0b11110'// is defined as floor division operator. It returns integer part of result of division operation>>> 10/3 3.3333333333333335 >>> 10//3 3For negative division, floor rounds towards negative infinity.>>> -10/3 ... Read More
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/7345/profile/60_93814-1511173378.jpg)
1K+ Views
In Python = symbol is defined as assignment operator. It requires one variable on its left and an expression on its right. Value of the expression on right is assigned to variable on left. Expression and name of variable are not interchangeable.>>> a=10 >>> b=20 >>> c=a+b >>> a,b,c (10, 20, 30) >>> a+b=c SyntaxError: can't assign to operatorThe == symbol is a comparison operator and called equal to operator. It returns true if operands on either side are equal, otherwise it returns false>>> 10+2 == 10 False >>> (10+2) == 12 True >>> 'computer' == 'Computer' False >>> 'computer' == "computer" True
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/7345/profile/60_93814-1511173378.jpg)
5K+ Views
In Python, and and or (along with not) are defined as logical operators. Both require two operands which may evaluate to true or false.The and operator returns True only if both operands are True.>>> a=50 >>> b=25 >>> a>40 and b>40 False >>> a>100 and b>> a==0 and b==0 False >>> a>0 and b>0 TrueThe or operator returns True if either operand is true.>>> a=50 >>> b=25 >>> a>40 or b>40 True >>> a>100 or b>> a==0 or b==0 False >>> a>0 or b>0 True
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/7345/profile/60_93814-1511173378.jpg)
1K+ Views
In Python or is a logical operator and | is a bitwise operator. The or operator requires two opeans of any type and may be true or false. It returns true if any one operand evaluates to true.>>> a=50 >>> b=25 >>> a>40 or b>40 True >>> a>100 or b>> a==0 or b==0 False >>> a>0 or b>0 TrueThe | operator takes bits as operands and returns 1 if any one operand is 1>>> a=10 #0000 1010 >>> bin(a) '0b1010' >>> b=20 #0001 0100 >>> bin(b) '0b10100' >>> c=a|b >>> c 30 #0001 1110 >>> bin(c) '0b11110'
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/7345/profile/60_93814-1511173378.jpg)
7K+ Views
The logical operators and, or and not are also referred to as boolean operators. While and as well as or operator needs two operands, which may evaluate to true or false, not operator needs one operand evaluating to true or false.Boolean and operator returns true if both operands return true.>>> a=50 >>> b=25 >>> a>40 and b>40 False >>> a>100 and b>> a==0 and b==0 False >>> a>0 and b>0 TrueBoolean or operator returns true if any one operand is true>>> a=50 >>> b=25 >>> a>40 or b>40 True >>> a>100 or b>> a==0 or b==0 False >>> a>0 or ... Read More