If I have two variables, a and b and they could be integers, float, or strings.
I want to return True
if they are equal (in case of string, ignore case).
As Pythonic as possible.
If I have two variables, a and b and they could be integers, float, or strings.
I want to return True
if they are equal (in case of string, ignore case).
As Pythonic as possible.
How about this, without isinstance (frowned upon):
This is the most pythonic I can think of. Better to ask for foregiveness than for permission: