Advertisement
fkudinov

8. Backward Each Word / Вирішуємо задачі на Python CheckIO Українською

Dec 7th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | Source Code | 0 0
  1. def backward_string_by_word(text: str) -> str:
  2.     return text
  3.  
  4.  
  5. if __name__ == '__main__':
  6.     print("Example:")
  7.     print(backward_string_by_word(''))
  8.  
  9.     # These "asserts" are used for self-checking and not for an auto-testing
  10.     assert backward_string_by_word('') == ''
  11.     assert backward_string_by_word('world') == 'dlrow'
  12.     assert backward_string_by_word('hello world') == 'olleh dlrow'
  13.     assert backward_string_by_word('hello   world') == 'olleh   dlrow'
  14.     assert backward_string_by_word('welcome to a game') == 'emoclew ot a emag'
  15.     print("Coding complete? Click 'Check' to earn cool rewards!")
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement