Close

Comparing different types in python

If someone already have experience with languages like C/C++, Java, C#
comparison between two variables of different types results in a compile error.
But in Python this will simply evaluate to false. So beware when comparing a string and int
containg same values. when we print, they look the same.
I actually faced this issue when I am receving a param from a config file
and comparing with some int value in the program something similar to the following.

Leave a Reply

Your email address will not be published. Required fields are marked *