Python Programming - Tricky Questions - Discussion

Discussion Forum : Tricky Questions - General Questions (Q.No. 24)
24.
What will be the output of the following Python code?
string1 = "Python"
string2 = "Python"
result = string1 is string2
print(result)
True
False
This code will result in an error.
Undefined
Answer: Option
Explanation:
String interning in Python makes identical string literals refer to the same memory location.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.