In this HackerRank Detect Floating Point, Number problem solution You are given a string N. Your task is to verify that N is a floating-point number.

HackerRank Detect Floating Point Number in python problem solution

HackerRank Detect Floating Point Number in python problem solution

import re

t = int(raw_input())

for i in range(t):
    n = str(raw_input())
   #print n
    regex = r'^[+-]?\d*.\d+$'
    print bool(re.match(regex,n))