Remove All Digits
Programming Interview
Medium
5 views
Problem Description
A string s is provided. Remove all digits (0-9) and output remaining string.
Output Format
One line without digits.
Official Solution
import sys
s=sys.stdin.read()
if s is None: sys.exit(0)
if s.endswith('\
'):
s=s[:-1]
out=[]
for ch in s:
if not ('0'<=ch<='9'):
out.append(ch)
sys.stdout.write(''.join(out))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!