作者ilvicco (家齐说我是蚂蚁)
看板Python
标题[问题]reverse string
时间Sat Nov 28 21:10:26 2009
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
1F:推 timerover:s = 'abc' 11/28 21:39
2F:→ timerover:s = s[::-1] 11/28 21:39