摘要: s = 'nihao1CJ' s1 = s.capitalize()#首字母大写其余全部小写 print(s1) s2 = s.upper()#全部大写 print(s2) s3 = s.lower()#全部小写 print(s3) s4 = s.swapcase()#大小写翻转 print(s4) s5 = s.title()#每个隔开(特殊字符或字母)的单词首字母大写 print(s5) ... 阅读全文
posted @ 2019-02-13 21:22 ChenGouDa 阅读(257) 评论(0) 推荐(0) 编辑
摘要: #1-2+3-4...+99除88以外的所有数的总和 cum = 0 count = 0 while count < 99: count += 1 #输出1-99 #print(count) if count == 88: continue if count % 2 == 0: cum -= count else: ... 阅读全文
posted @ 2019-02-13 10:11 ChenGouDa 阅读(84) 评论(0) 推荐(0) 编辑