摘要:
1、实例: 下载一首英文的歌词或文章,将所有,.?!等替换为空格,将所有大写转换为小写,统计某几个单词出现的次数,分隔出一个一个的单词。 str='''However,Xi wants more effort to be taken to build a safer China.The author 阅读全文
摘要:
1、恺撒密码的编码 plaincode=input('明文:')print('密文:',end='')for i in plaincode: 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=in 阅读全文
摘要:
1、画五角星 import turtleturtle.bgcolor('red')turtle.color('yellow')turtle.fillcolor('yellow')turtle.begin_fill() for i in range(5): turtle.forward(100) tu 阅读全文
摘要:
1、画一组同切圆 import turtleturtle.shape('turtle')turtle.circle(10)turtle.circle(30)turtle.circle(50)turtle.circle(70) 2、画一组同心圆 import turtleturtle.shape('t 阅读全文
摘要:
1、简单输入输出交互。 print('Hello World')input('please input your name:')name=input(':')print(name)name=input('What is your name?/n')print('Hi,%s'%name) 2、用户输入 阅读全文