I have a dict like this tmp_dic = {'0.0': 'val0', '1': 'val1', 'key3': 'val2'}
. Now during parsing a file, I wanna check if for instance a float value of lets say 1.0 is in tmp_dic keys or not? I have a simple logic like this, but seems it can return wrong answer sometimes.
str(int(1.0)) in tmp_dic.keys()
Do I need to check if numeric string is integer or float before checking if they exists in the keys? Thanks for the hints.