converting decimal to hex in python

def convert_to_hex(number:int):
    if number == None:
        return "Invalid input"
    elif type(number) == float:
        return "Float not handled"
    elif type(number) == str:
        temp = int(number)
        return format(temp, "02x")
    return format(number, '02x')
print(convert_to_hex(30))
print(convert_to_hex(None))
print(convert_to_hex("7"))
print(convert_to_hex(7.09))

Here is what the above code is Doing:
1. The function takes in a number as an argument.
2. The function checks if the number is None. If it is, it returns “Invalid input”.
3. The function checks if the number is a float. If it is, it returns “Float not handled”.
4. The function checks if the number is a string. If it is, it converts the string to an integer and then returns the hexadecimal value of the integer.
5. If the number is not a string, it returns the hexadecimal value of the number.