You are viewing a single comment's thread. Return to all comments →
here is my solution
import re l = int(input()) for _ in range(l): N = input() pattern = r"[+-]?\d*.\d+" if re.fullmatch(pattern, N): print("True") else: print("False")
Seems like cookies are disabled on this browser, please enable them to open this website
Detect Floating Point Number
You are viewing a single comment's thread. Return to all comments →
here is my solution
import re l = int(input()) for _ in range(l): N = input() pattern = r"[+-]?\d*.\d+" if re.fullmatch(pattern, N): print("True") else: print("False")