摘要: samp_string = "Whatever you are, be a good one." for i in samp_string: print(i) for i in range(0,len(samp_string)-2,2): print(samp_string[i]+samp_string[i+1]) print('A=',ord("A")) print('65... 阅读全文
posted @ 2019-05-22 22:17 木&子 阅读(326) 评论(0) 推荐(0) 编辑
摘要: # Strings have many methods wo can use rand_string=" life is a beautiful struggle " print("去除左边空格:",rand_string.lstrip()) print("去除右边的空格:",rand_string.rstrip()) print("去除两边的空格:",rand_string.s... 阅读全文
posted @ 2019-05-22 22:16 木&子 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 格式化对象为字符串:%s 格式化对象为整数:%d 阅读全文
posted @ 2019-05-22 17:38 木&子 阅读(7788) 评论(0) 推荐(0) 编辑