摘要: import json # json反序列化 # json_str = '{"name":"qiyue","age":18}' # student = json.loads(json_str) # print(type(student)) # # print(student) # {'name': 'qiyue', 'age': 18} # print(student['... 阅读全文
posted @ 2018-04-20 22:43 邹柯 阅读(147) 评论(0) 推荐(0) 编辑
摘要: # 1.检查一串数字是否是电话号码 # 2.检查一个字符串是否符合email # 3.把一个文本里指定的单词替换为另一个单词 import re # a = 'C|C++|Java|C#|Python|Javascript' # print(a.index('Python') > -1) # True # print('Python' in a) # True # r=r... 阅读全文
posted @ 2018-04-20 22:10 邹柯 阅读(309) 评论(0) 推荐(0) 编辑