摘要: r'[\u4e00-\u9fa5]汉字 .匹配除换行符外的任意字符 \d匹配所有数字 ,与[0-9]相同[0123456789] \D匹配非数字字符,[^0-9] \w匹配数字,字母,下划线[0-9a-zA-Z_] \W匹配非数字 字线 下划线[^0-9A-Za-z] \s匹配任意空白符(空格 换行 阅读全文
posted @ 2020-02-14 20:18 myrj 阅读(128) 评论(0) 推荐(0)
摘要: 执行过程中出错,复制错误信息,利用TRY得到相应的错误,并用特别方法解决: print(3/0)提示: Traceback (most recent call last): File "<pyshell#0>", line 1, in <module> print(3/0)ZeroDivisionE 阅读全文
posted @ 2020-02-14 18:15 myrj 阅读(164) 评论(0) 推荐(0)
摘要: import itertools mylist=list(itertools.permutations([1,2,3,4],3)) #排列 print(mylist) print(len(mylist)) mylist=list(itertools.combinations([1,2,3,4],3) 阅读全文
posted @ 2020-02-14 17:41 myrj 阅读(181) 评论(0) 推荐(0)