看板 Python 關於我們 聯絡資訊
Please write a function to inverse a string. This function accept a string argument and return the reversed string. For example, reverse (‘apple’) returned ‘elppa’ reverse(‘madam’) returned ‘madam’. Hine: (1) set local variable y = ‘’。 (2) from right to left, read a char from input string and append to the end of y. (3) return y as result reverse 要怎麼寫? 我只是個新手希望大家幫幫我~~謝謝:) -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.44.148.189
timerover:s = 'abc' 11/28 21:39
timerover:s = s[::-1] 11/28 21:39