In a recent YouTube Shorts video, Python teacher Saurabh Chauhan posed a question that commonly trips up beginners:
x = 5
y = "5"
print(x == y) # What's the output?
The correct answer is False. Although both variables hold the value 5, they are different data types: x is an integer, while y is a string. Python's == operator checks both value and type equality, so comparing an integer to a string yields False.
Chauhan explains that about 90% of students get this wrong, highlighting a fundamental concept in Python: the strict separation between data types. This simple example serves as a reminder to always check types when writing comparisons, especially when dealing with user input or dynamic data.
For more Python tips and tricks, follow Saurabh Chauhan on YouTube under the handle @SaurabhTechStudio.