摘要: 代码:import strings = ' The quick brown fox jumped over the lazy dog. 'print sprint string.capwords(s)结果: The quick brown fox jumped over the lazy dog.The Quick Brown Fox Jumped Over The Lazy Dog.请按任意键继续. . .string模块中的capwords()函数,除了可以将每个单词首字母大写以外,它还能够去除两端的空格,再将连续的空格用一个空格代替。 阅读全文
posted @ 2011-06-30 22:56 Sean Lv 阅读(3309) 评论(2) 推荐(0) 编辑