num2 = 10
num3 = 10
list1 = [6,7,8]
list2 = [6,7,8]
print(num2 is not num3) # Both have the same object
print(list1 is list2) # Both have the different objects
OUTPUT: false
false
It shows false in both the print cases. I am not able to understand regarding the objects which has been mentioned in the comment part for explaining this output . Please elaborate the reason, how both the print cases are different in terms of object.
And also please clarify list1 = [6,7,8] & list2 = [6,7,8] are equal or not? I think if the order of the elements are different then the lists are said to be unequal otherwise if the order is same then it is said equal.
Type your question above this line.
Course: https://www.educative.io/collection/10370001/5473789393502208
Lesson: https://www.educative.io/collection/page/10370001/5473789393502208/5429296082452480