InterviewSolution
Saved Bookmarks
| 1. |
How can you differentiate between “is” and “==” operators in Python? |
|
Answer» “is” operator is used for the purpose of REFERENCE equality to check whether the two references or variables are pointing to the same OBJECT or not. ACCORDINGLY, it returns value as true or false. “==” operator is used for the purpose of value equality to check whether the two variables are having same value or not. Accordingly, it returns value as true or false. We can take any example with the HELP of two lists X and Y. X = [1,2,3,4,5] Y = [1,2,3,4,5] Z = Y
|
|