Answers for "if type(1) == int or float:"

1

isinstance float or int

#checks if var is float or integer
isinstance(var, (float, int))
Posted by: Guest on February-06-2021
2

check if float is integer python

>>> def isFloatInteger(float):
>>> 	return float.is_integer()
>>> isFloatInteger(0.62)
False
>>> isFloatInteger(1.00)
True
Posted by: Guest on December-19-2020

Code answers related to "if type(1) == int or float:"

Python Answers by Framework

Browse Popular Code Answers by Language