Input Format
The first line contains an integer , the number of test cases.
The next  line(s) contains a string .
Constraints
Output Format
Output True or False for each test case.

hackerrank detect floating point number problem solution in python

Problem solution in Python 3 programming language.

import re
for i in range(int(input())):
    print(bool(re.search(r"^[+-]?\d*\.\d+$",raw_input().strip())))

Second solution

# Enter your code here. Read input from STDIN. Print output to STDOUT
import re
for _ in range(int(input())):
    print(re.search(r'^([-\+])?\d*\.\d+$'input()) is not None)

Problem solution in Python 2 programming language.

import re
for i in range(int(raw_input())):
    print bool(re.search(r"^[+-]?\d*\.\d+$",raw_input().strip()))