
python
坚持奋斗的李洛克
这个作者很懒,什么都没留下…
展开
-
从程序中学python-2
import string import sys punctuations = string.punctuation + string.whitespace #标点符号和空格(换行,制表符等) def countWords(file): with open(file,'r') as f: lines = f.readlines() words_list=[] for line in lines: words = line.split()原创 2020-08-31 17:39:16 · 153 阅读 · 0 评论 -
从程序中学python
import random import string chars = string.ascii_letters + string.digits # 26个字母的大小写和数字组合 def generateCode(count, length): for x in range(count): code = '' for y in range(length): code = code + random.choice(chars)原创 2020-07-26 20:28:38 · 206 阅读 · 0 评论