Input:1good23morning456
Output: goodmorning 123456
Explanation:given a string, write a program to remove all the numbers in it to its end.
line = input()
letters = ''
digits = ''
for ch in line:
if '0' <= ch <= '9':
digits += ch
else:
letters += ch
print(letters, digits)
Comments
Leave a comment