Input Format
The first line contains an integer , the number of test cases.
The next  line(s) contains a string .
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())):

Second solution

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

Problem solution in Python 2 programming language.

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