You are viewing a single comment's thread. Return to all comments →
is it me or just an error that the following code doesn't work for string(0) (='0')
I still dont get why it doesn't print out anything nor True, nor False. just nothing printed out for '0'
import re T = int(input()) for _ in range(T): string = str(input()) try: if float(string): if re.match('([\\+\\-]?\d*\\.\d+)', string): print(True) except Exception: 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 →
is it me or just an error that the following code doesn't work for string(0) (='0')
I still dont get why it doesn't print out anything nor True, nor False. just nothing printed out for '0'