Remove Spaces
Python
Easy
3 views
Problem Description
A string s is provided. Remove all space characters and output the new string.
Output Format
One line without spaces.
Official Solution
import sys
s=sys.stdin.read()
if s is None: sys.exit(0)
if s.endswith('\
'):
s=s[:-1]
sys.stdout.write(''.join(ch for ch in s if ch!=' '))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!