摘要: #1. bigFile = open('big.txt',mode='r',encoding='utf-8') bigText=bigFile.read() bigFile.close() print(bigText) #2. replaceList=[',','.',"'",'\n'] for c 阅读全文
posted @ 2018-06-20 21:34 朱靖萍 阅读(90) 评论(0) 推荐(0) 编辑
摘要: def hanoi(n,a,b,c): if n==1: print(n,a+'->'+c) else: hanoi(n-1,a,c,b) print(n,a+'->'+c) hanoi(n-1,b,a,c) hanoi(8,'A','B','C') 阅读全文
posted @ 2018-06-13 21:44 朱靖萍 阅读(92) 评论(0) 推荐(0) 编辑
摘要: l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,85,75] d = {'Michael':95,'Bob':85,'Tracy':75} d['Bob'] = 82 d['Rose'] = 88 d.pop('Bob') p. 阅读全文
posted @ 2018-06-06 21:26 朱靖萍 阅读(255) 评论(0) 推荐(0) 编辑
摘要: id= '440404199810072828' area = id[0:6] birthday = id[6:14] sex = id[-2] print(area,birthday,sex) if (int(sex) % 2 == 0): print('girl') else: print('boy') for i in range(12): print(9... 阅读全文
posted @ 2018-05-23 21:41 朱靖萍 阅读(119) 评论(0) 推荐(0) 编辑
摘要: import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown() def dra... 阅读全文
posted @ 2018-05-16 20:38 朱靖萍 阅读(137) 评论(0) 推荐(1) 编辑
摘要: import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("red") turtle.begin_fill() turtle.circle(10, 180) turtle.circle(25, ... 阅读全文
posted @ 2018-05-09 20:57 朱靖萍 阅读(196) 评论(0) 推荐(0) 编辑
摘要: myNumber = 7 while True: guess = int(input('请输入一个数量:')) if guess > myNumber: print('输入的数量过大') elif guess < myNumber: print('输入的数量过小') else: print('输入的 阅读全文
posted @ 2018-05-02 21:22 朱靖萍 阅读(135) 评论(0) 推荐(0) 编辑
摘要: a=input('请输入摄氏温度') sum2=int(a)*5/9+32 print('转换的摄氏度是:{}'.format(sum2)) a=input('请输入华氏温度') sum2=int(a)*5/9-32 print('转换的摄氏温度是;{}'.format(sum2)) 阅读全文
posted @ 2018-04-25 20:16 朱靖萍 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 请输入摄氏温度5 转换的摄氏度是:34.77777777777778 >>> 阅读全文
posted @ 2018-04-25 19:50 朱靖萍 阅读(118) 评论(0) 推荐(0) 编辑
摘要: == RESTART: C:/Users/teacher/AppData/Local/Programs/Python/Python36-32/2.py == 请输入一个名字: == RESTART: C:/Users/teacher/AppData/Local/Programs/Python/Python36-32/2.py == 请输入一个名字:鹿晗 再输入一个名字:屁屁 请输入一辆车:兰博基... 阅读全文
posted @ 2018-04-18 21:38 朱靖萍 阅读(244) 评论(0) 推荐(0) 编辑