Question : python how to check if string contains only numbers
Answered by : quaint-quelea-8kgm28zumzo0
print("012345".isdecimal())
OUTPUT
True
print("a12345".isdecimal())
OUTPUT
False
Source : https://www.kite.com/python/answers/how-to-check-if-a-string-contains-only-numbers-in-python | Last Update : Thu, 01 Oct 20
Question : Python check if string contains number
Answered by : raamzan-raamzaan
def containsNumber(value): for character in value: if character.isdigit(): return False return True
Source : https://codefather.tech/blog/check-if-python-string-contains-number/ | Last Update : Mon, 15 Aug 22