<\/span><\/h2>\n\n\n\nYou are given a string N<\/em><\/strong>.
Your task is to verify that N<\/em><\/strong> is a floating point number.<\/p>\n\n\n\nIn this task, a valid float number must satisfy all<\/em> of the following requirements:<\/p>\n\n\n\n><\/strong>Number can start with +<\/code><\/strong>, -<\/code><\/strong> or .<\/code><\/strong> symbol.
For example:
\u2714+4.50
\u2714-1.0
\u2714.5
\u2714-.7
\u2714+.4
\u2716 -+4.5<\/code><\/strong><\/p>\n\n\n\n><\/strong>Number must contain at least<\/em> 1<\/strong> decimal value.
For example:
\u2716 12.<\/code><\/strong>
\u271412.0 <\/p>\n\n\n\n ><\/strong>Number must have exactly one .<\/code><\/strong> symbol.
><\/strong>Number must not give any exceptions when converted using float(N)<\/em><\/strong>.<\/p>\n\n\n\n<\/span>Input Format<\/strong><\/span><\/h2>\n\n\n\nThe first line contains an integer T<\/em><\/strong>, the number of test cases.
The next T<\/em><\/strong> line(s) contains a string N<\/em><\/strong>.<\/p>\n\n\n\n<\/span>Constraints<\/strong><\/span><\/h2>\n\n\n\n- 0 < T<\/em> < 10<\/strong><\/li><\/ul>\n\n\n\n
<\/span>Output Format<\/strong><\/span><\/h2>\n\n\n\nOutput True<\/em> or False<\/em> for each test case.<\/p>\n\n\n\nSample Input 0<\/strong><\/p>\n\n\n\n4\n4.0O0\n-1.00\n+4.54\nSomeRandomStuff<\/code><\/pre>\n\n\n\nSample Output 0<\/strong><\/p>\n\n\n\nFalse\nTrue\nTrue\nFalse<\/code><\/pre>\n\n\n\nExplanation 0<\/strong><\/p>\n\n\n\n4.0O<\/em>0<\/strong>: O<\/em> is not a digit.
-1.00<\/strong>: is valid.
+4.54<\/strong>: is valid.
SomeRandomStuff<\/em>: is not a number.<\/p>\n\n\n\n<\/span>Solution – Detect Floating Point Number in Python <\/strong><\/span><\/h2>\n\n\n\n# Enter your code here. Read input from STDIN. Print output to STDOUT\nfrom re import match, compile\n\npattern = compile('^[-+]?[0-9]*\\.[0-9]+$')\nfor _ in range(int(input())):\n print(bool(pattern.match(input())))<\/pre>\n\n\n\n