line = input()
# 1.
print(' '.join(word[::-1] for word in line.split()))
# 2.
print('-'.join(line.split('-')[::-1]))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
line = input()
# 1.
print(' '.join(word[::-1] for word in line.split()))
# 2.
print('-'.join(line.split('-')[::-1]))
line = ('\n'.join(''.join(reversed(word)) for word in line.split()))
print(line) вот, переписал. Все равно в строку выводит, не в столбец(((
line = list(input())
line.reverse()
for char in line:
print(char)
print('\n'.join(reversed(line)))