字符串逆序[Python]
2014-04-21 10:50 三犬风 阅读(412) 评论(0) 编辑 收藏 举报str = 'yob a ma i' # 10 def recursion(mystr): global rstr index = 0 strlen = len(mystr) if 1 != strlen: recursion(mystr[index+1:strlen]) print mystr[index] rstr += mystr[index] rstr= '' recursion(str) print rstr
Always go with the choice that scares you the most, because that's the one that is going to require the most from you!