What is the syntax to see if a string only contains numbers?

<string name>.isdigit()
#examples
str = 'HELLOWORLD123'
str2 = "12345"

print(str.isdigit())
print(str2.isdigit())

#output
False
True
Advertisements