Detect Floating Point Number

  • + 0 comments
    T = int(input())
    
    for k in range (T) :
        x = 1
        s = input()
        
        try :
            y = float (s)
            if s.count(".") == 0 :
                x *= 0
                
        except :
            x *= 0 
               
        print(bool(x))