摘要: l = ['Michael','Bob','tracy'] l.append('Bob') l.pop() print(l) t = ('Michael','Bob','Tracy') scores = [95, 75, 85] d ={'Michael':95,'Bob':75, 'Tracy':85} d['Bob'] = 82 d['Rose'] = 88 d.pop('Bob') 阅读全文
posted @ 2018-06-06 21:34 mablenmx 阅读(111) 评论(0) 推荐(0)
摘要: fr = open('ccc.txt',mode='r',encoding='utf-8') plaincode = fr.read() print('明文:' + plaincode) print('密文:',end='') for c in plaincode: print(chr(ord(c)+3),end='') fr = open('ccc.txt',mode=... 阅读全文
posted @ 2018-05-30 21:19 mablenmx 阅读(133) 评论(0) 推荐(0)
摘要: id = '440106193805060424' 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(98... 阅读全文
posted @ 2018-05-23 21:23 mablenmx 阅读(83) 评论(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() mygot... 阅读全文
posted @ 2018-05-16 20:34 mablenmx 阅读(120) 评论(0) 推荐(0)
摘要: import turtle #五角星 turtle.pencolor('yellow') turtle.fillcolor('yellow') turtle.begin_fill() turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100... 阅读全文
posted @ 2018-05-09 21:02 mablenmx 阅读(206) 评论(0) 推荐(0)
摘要: number = 7 while True: guess =int(input()) if guess > number: print('>') elif guess >> import turtle >>> turtle.circle(50) >>> turtle.circle(100) >>> turtle.circle(150) ... 阅读全文
posted @ 2018-05-02 21:55 mablenmx 阅读(129) 评论(0) 推荐(0)
摘要: while True: a=int(input('摄氏转华氏请按 1\n华氏转摄氏请按 2\n退出请按 3\n ') ) if a==1: c = float(input('请输入摄氏温度:') ) f = c*9/5+32 print ('摄氏{:.2f}的华氏为{:.2f}\n'.format( 阅读全文
posted @ 2018-04-25 21:43 mablenmx 阅读(105) 评论(0) 推荐(0)
摘要: a = input('请输入一个数') b = input('请输入第二个数') sum2=int(a) + int(b) print('两个数的和是:{}'.format(sum2)) a = input('请输入一个摄氏温度') sum2=int(a) * 9/5 +32 print('转换的华氏温度是:{}'.format(sum2)) 阅读全文
posted @ 2018-04-18 21:31 mablenmx 阅读(119) 评论(0) 推荐(0)
摘要: name1=input('请输入第一个名字') name2=input('请输入第二个名字') place=input('请输入一的地方') print('{}被一只猪拱下水后,就要{}带他去{}学习武功,不想再被猪拱下水'.format(name1,name2,place)) 阅读全文
posted @ 2018-04-18 20:37 mablenmx 阅读(111) 评论(0) 推荐(0)