摘要:
1、字典实例:建立学生学号成绩字典,做增删改查遍历操作。 建立: d={'0001':'99','0003':'89','0004':'98','0005':'100','0006':'78'} 增:d['0002']='79' 删:d.pop('0001') 改:d['0004']=100 查:p 阅读全文
摘要:
1、实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词。 >>> bin='''Put your make up on Get your nails done Curl your hair Run the extra m 阅读全文
摘要:
1、恺撒密码的编码 code=input('明文:')print('密文:',end='')for i in code: print(chr(ord(i)+3),end='') 2、国家名称 GDP总量(人民币亿元)中国 ¥765873.4375澳大利亚 ¥ 78312.4375(国家名称左对齐,数 阅读全文
摘要:
1、已知‘星期一星期二星期三星期四星期五星期六星期日 ’,输入数字(1-7),输出相应的‘星期几’。 s="星期一星期二星期三星期四星期五星期六星期日"d=int(input("输入1-7:"))print('今天是',s[3*(d-1):3*d]) 2、输入学号,识别年级、专业、班级、序号 s=i 阅读全文
摘要:
a、画五角星 import turtleturtle.color('yellow')turtle.fillcolor('yellow')turtle.begin_fill()for i in range(5): turtle.forward(200) turtle.right(144) turtle 阅读全文
摘要:
1、画一组同切圆 >>> import turtle >>> turtle.circle(50) >>> turtle.circle(80)>>> turtle.circle(100)>>> turtle.circle(60)>>> turtle.circle(70)>>> turtle.circl 阅读全文
摘要:
1、简单输入输出交互。 输出:print(‘Hollo world!') Hollo world 输入:input('please input your name:') please input your name:bin 'bin' name=input(':') :bin print(name) 阅读全文