2019年3月4日

字典操作

摘要: #字典的操作d = {'name':'chuxu','age':90,'sex':'man'}#返回字典索引的键print(d.keys())#返回字典索引的值print(d.values())#把字典dict2的键/值对更新到dict里c = {}print(c.update(d))print(c 阅读全文

posted @ 2019-03-04 22:36 储旭 阅读(80) 评论(0) 推荐(0)

字符串函数

摘要: #字符串转换为小写print(s.lower())#字符串转换为大写print(s.upper())#字符串首字母转换为大写print(s.capitalize())#判断字符串首字母是否为Lprint(s.startswith('L'))#判断字符串结尾字母是否为Tprint(s.endswith 阅读全文

posted @ 2019-03-04 22:26 储旭 阅读(95) 评论(0) 推荐(0)

导航