Python基礎:給定一個字符串,逐個翻轉字符串中的每個單詞

翻轉字符串裏的單詞 Given an input string, reverse the string word by word. 示例 1: 輸入: 「the sky is blue」 輸出: 「blue is sky the」 示例 2: 輸入: " hello world! " 輸出: 「world! hello」 解釋: 輸入字符串可以在前面或者後面包含多餘的空格,但是反轉後的字符不能包括
相關文章
相關標籤/搜索