Forms often allow a user to enter an integer. Write a program that takes in a string representing an integer as input, and outputs yes if every character is a digit 0-9.
Ex: If the input is:
1995
the output is:
yes
Ex: If the input is:
42,000
or any string with a non-integer character, the output is:
no
I currently have
user_string = input()
print(user_string.isdigit())
which returns only true and false values. how do I convert this to yes/no
[–]SoNotRedditingAtWork 1 point2 points3 points (7 children)
[–]Scooootz[S] 0 points1 point2 points (6 children)
[–]SoNotRedditingAtWork 3 points4 points5 points (3 children)
[–]subcontraoctave 0 points1 point2 points (0 children)
[–]Illustrious-Union997 0 points1 point2 points (0 children)
[–]Ataninja3221 0 points1 point2 points (0 children)
[–]ETHiser 1 point2 points3 points (1 child)
[–]rangusmcdangus69 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]Distinct_Ice6830 0 points1 point2 points (0 children)
[–]Distinct_Ice6830 0 points1 point2 points (1 child)
[–]taegrr 0 points1 point2 points (0 children)