[Begginer][Python] Egregiously Simple IF statements NOT working : > Write a function integer_type that consumes a value of any type and produces "Even integer" if it is an even integer, "Odd integer" if it is an odd integer, and "Not an integer" otherwise.

    def integer_type(som):
        if type(som)==type(0):
            if som%2==0:
            return "Even integer"
            else:
            return "Odd integer"
        else:
            return "Not an integer"
    x= input()
    print(integer_type(x))

Everytime I run it it completely skips over if regardless of its an integer or a string and prints "Not an integer"

I tried a different problem with elifs instead and its made no difference. I still obtain the very last "else" return for my print.

> Write a function off_peak that consumes any type of data and determines if the time is eligible for off peak rates. Your function should produce one of the following outputs: "Off peak", "Peak", and "Not a time". Off-peak rates are based on 24-hour time, for values less than 9 or greater than 17.

    def off_peak(any):
        if type(any)==type(0) and any<9 and any>17:
            return "Off peak"
        elif type(any)==type(0) and 9<any<17 and 0<any<23:
            return "Peak"
        else:
            return "Not a time"
         
    x= input("Peak Dector:")
    print(off_peak(x))

any help would be greatly appreciated