上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 36 下一页
摘要: # from enum import Enum # 枚举 # class VIP(Enum): # YELLOW = 1 # YELLOW_ALIAS = 1 # 别名 # GREEN = 2 # BLACK = 3 # RED = 4 # print(VIP.GREEN) # VIP.GREEN8VIP.GREEN # print(VIP... 阅读全文
posted @ 2018-04-21 14:09 邹柯 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
摘要: n3.py n4.py 阅读全文
posted @ 2018-04-18 16:27 邹柯 阅读(146) 评论(0) 推荐(0) 编辑
摘要: # 函数 # 1.功能性 # 2.隐藏细节 # 3.避免编写重复代码 # 4. # print() # round() a = 1.12386 # 保留3位小数 result=round(a,3) print(result) # 定义函数 # def funcname(paramter_list) # pass # 1.参数列表可以没有 # 2.return value none... 阅读全文
posted @ 2018-04-16 18:12 邹柯 阅读(134) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 36 下一页