摘要:
Problem:You want to reverse the characters or words in a string.Solution:使用字符串的切片操作 [start: stop : step], 当 step为-1时,可实现字符反转操作revchars = astring [::-1]为了实现words的反转,需要建立一个列表来保存words,astring = 'hello wo... 阅读全文
posted @ 2010-05-31 12:43
Py&禅
阅读(246)
评论(0)
推荐(0)
浙公网安备 33010602011771号