- 博客(5)
- 收藏
- 关注
原创 Python学习--9、10
Chapter 9函数含义shutil.copy(source,destination)将路径source处的文件复制到路径destination处的文件夹shutil.copytree(source,destination)将路径source处的文件夹复制到路径destination(新文件名)处的文件夹shutil.move(source,destination)移动文件夹,返回新路径的字符串;移动文件,返回包括原来的文件名的路径os.unlink(path
2020-07-10 22:46:40
314
原创 Python学习--3,4
Chapter 3def函数(return语句–指定返回值)import random #导入模块def get(num): #定义函数 if num==1: return 'it is ok.' elif num==2: return 'it is fine.' elif num==3: return 'it is bad.' elif num==4: return 'it is boring.'
2020-07-09 17:25:08
613
原创 Python学习--5、6
Chapter 5字典–{键:值}birth={'psc':'8.10','hl':'5.28','wx':'3.7'} while True: print('Enter the name:') name=input() if name=='': break if name in birth: print(birth[name]+' is the birth '+name) else: print('No reco
2020-07-09 17:22:08
1025
原创 Python学习-7.8
Chapter普通/正则表达式查找#用不正则表达式查找文本def isphone(text): if len(text)!=12: return False for i in range(0,3): if not text[i].isdecimal(): return False if text[3]!='-': return False for i in range(4,7): i
2020-07-09 17:20:50
267
原创 python学习(1.2)
Chapter 1操作符操作例子**指数2**3=8%取余数22%8=6//商数取整22//8=2+加法/字符串连接a+b=ab*乘法/字符串复制a*3=aaa变量名规则只能是一个词只能包含字母、数字和下划线不能以数字开头...
2020-07-09 17:19:35
216
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人