摘要:
方法一,使用[::-1]:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--s='python'prints[::-1]方法二,使用reverse()方法:Code highlighting produced by Actipro CodeHighlig... 阅读全文
摘要:
join 方法用于连接字符串数组Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--s=['a','b','c','d']print''.join(s)print'-'.join(s)输出结果:abcda-b-c-d使用 % 连接多个变量Code high... 阅读全文