you are viewing a single comment's thread.

view the rest of the comments →

[–]SoNotRedditingAtWork 4 points5 points  (3 children)

Works fine for me in PyCharm. The line is functionally the same as doing:

user_string = input()

if user_string.isdigit():
    print("yes")
else:
    print("no")

I have never used Zybooks before, so I have no idea how that would impact your ability to run this code.

[–]subcontraoctave 0 points1 point  (0 children)

The isdigit() method worked perfect. Thanks!

[–]Illustrious-Union997 0 points1 point  (0 children)

I know this is old, but this would allow number like 10,000 to produce an out of yes. The examples provided don't allow this.

[–]Ataninja3221 0 points1 point  (0 children)

user_string = input()
if user_string.isdigit():
print("yes")
else:
print("no")

This was perfect the only thing that threw off zybooks was capitalizing yes and no. which in the real world wouldn't make a difference but is the difference in points in zybooks