There are several approaches:
e.g. you can test the variable for it's "type".
e.g. you can test the variable for it's "type".
a = 3.5 b = 5 if type(a) == float: print(a) if type(b) == int: print(b)or you could do
if int(b) == b: print(int(b))Paul
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.