Can you guess what value the variable a
has to take, so that this program prints A is not equal A!
?
if a != a:
print("A is not equal A!")
💡🐍 I have a small Python quiz for you:
❓What value must the variable a take for the following code to print
A is not equal A!15:55 PM - 13 May 2022
Top comments (4)
float('nan')
That's cool! I'm wondering what's the reason for the same? Please explain
Nan stands for “not a number” and comparing two things we know nothing about (other than what they’re not) is not reasonable.
Therefore by definition, nan is not the same as another nan.
That’s correct!