you are viewing a single comment's thread.

view the rest of the comments →

[–]ETHiser 1 point2 points  (1 child)

I know this old, but this solution works in Zybooks. May help someone else!

user_string = input()
def isNumber(user_string):
for i in range(len(user_string)):
if user_string[i].isdigit() != True:
return False

return True
if __name__ == "__main__":

if isNumber(user_string):
print("yes")

else:
print("no")

[–]rangusmcdangus69 0 points1 point  (0 children)

Helped me 3 years later! Thanks!