Only Digits Check
Python
Easy
3 views
Problem Description
String s is provided (no spaces). Output YES if all characters are digits, else NO.
Input Format
One string s.
Official Solution
import sys
s=sys.stdin.read().strip()
if not s: sys.exit(0)
sys.stdout.write('YES' if s.isdigit() else 'NO')
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!