Detect Floating Point Number

  • + 0 comments

    import re n = int(input()) a = [input() for i in range(n)] pattern = re.compile(r'^[+-.]?\d*.{1}[0-9]{1,}$') for i in a: if (pattern.match(i)): print("True") else: print("False")