We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Detect Floating Point Number
Detect Floating Point Number
Sort by
recency
|
559 Discussions
|
Please Login in order to post a comment
This prints True for '0' when I submit code
This prints False for '0' when I submit code
what am I missing here?
It should be the reverse, i.e. second statement above should be "True" (see regex101.com link) https://regex101.com/r/dIOXFe/1
T = int(input())
for n in range(1, T+1):
x = int(input()) lst = [input() for i in range(x)] for i in lst: if i == '0': print("False") try: if float(i): print("True") except: print("False")
Can't we use while !