Detect Floating Point Number

  • + 0 comments
    import re
    T = int(input())
    N = [input() for _ in range(T)]
    for x in N:
        if re.match(r'^[+-]?\d*\.\d+$', x):
            print(True)
        else:
            print(False)