Feature or enhancement
Proposal:
A string method called .isnumber(), it will check if a string is a float or an integer and return True or False.
def isnumber(text)
try:
float(text)
return True
except ValueError:
return False
Examples:
abc = "123"
pi = "3.14159"
hello = "hello"
print(isnumber(abc)) # True
print(isnumber(pi)) # True
print(isnumber(hello)) # False
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
Feature or enhancement
Proposal:
A string method called .isnumber(), it will check if a string is a float or an integer and return True or False.
Examples:
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response