djfz-2020-s450026/TaskA04/A04.py

14 lines
322 B
Python
Raw Normal View History

2020-11-08 21:23:29 +01:00
import sys
def contains_number(line):
result = ''.join((char if char in "0123456789" else " ") for char in line)
list_of_nums = result.split()
return " ".join([str(num) for num in list_of_nums])
for line in sys.stdin:
words = contains_number(line).rstrip("\n")
if words != "":
print(words)