HackerRank Python - Detect Floating Point Number




You are given a string N.
Your task is to verify that N is a floating point number.

In this task, a valid float number must satisfy all of the following requirements:



  1. # Enter your code here. Read input from STDIN. Print output to STDOUT
  2. from re import match, compile
  3. pattern = compile('^[-+]?[0-9]*\.[0-9]+$')
  4. for _ in range(int(input())):
  5. print(bool(pattern.match(input())))




codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube