摘要:
yaFile = open('ya.txt','r',encoding= 'utf-8') yaText = yaFile.read() yaFile.close() print(yaText) replacelist = [',',"'",'\n'] for c in replacelist: yaText = yaText.replace(c,' ') print(yaText) ... 阅读全文
摘要:
l = [['Apple','Google','Microsoft'],\ ['Java','Python','Ruby','PHP'],\ ['Adam','Bart','Lisa']\ ] names= ['Michael','Bob','Tracy'] #list print(names[1]) scores = [95,75,85] #list ... 阅读全文
摘要:
plainText = input('message:') for c in plainText: print(chr(ord(c)+5)) plainText = input('message:') for c in plainText: print(chr(ord(c)-5)) for i in range(12): print(98... 阅读全文
摘要:
import turtle turtle.setup(600,400,0,0) turtle.bgcolor('blue') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown() def ... 阅读全文
摘要:
import turtle turtle.setup(600.,600,0,0) turtle.bgcolor('blue') turtle.color('red') turtle.fillcolor('red') turtle.begin_fill() for i in range(5): tur 阅读全文
摘要:
import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("blue") turtle.begin_fill() turtle.circle(10, 180) turtle.circle(25, 11... 阅读全文
摘要:
while True: a = input('1:摄氏温度转为华氏温度请按\n2:华氏温度转为摄氏温度请按\n3:退出\n') if a =='1': c = float(input('请输入华氏温度:')) f = c*9/5+32 print('{:.2f}摄氏温度转为华氏温度为:{:.2f}\ 阅读全文
摘要:
c = float(input('请输入华氏温度:')) f = c*9/5+32 print('{:.2f}摄氏温度转为华氏温度为:{:.2f}'.format(c,f)) f = float(input('请输入摄氏温度:')) c = 5/9*(f-32) print('{:.2f}华氏温度转为摄氏温度为:{:.2f}'.format(f,c)) 阅读全文
摘要:
name1 = input('请输入一个名字:') name2 = input('再输入一个名字:') sentence = input('请输入一句话:') name3 = input('再输入一个名字:') print('当{}说,京都和神户产生了远距离的恋爱,{}微笑着说{},远在天边的{}, 阅读全文