So I've been trying to make a program to convert float into a integer and if the input is not a float (such as a string) just return the string:
def convert(n):
if n == float:
return int(n)
else:
return n
However when I give it a float such as 1.0 it will only return 1.0 and totally not convert it.
Does anyone know what is going on here? Any help will be accepted.