摘要:
#1, riverFile = open('river.txt','r') riverTest = riverFile.read() riverFile.close() print(riverTest) #2, print(riverTest.replace(',',' ')) print( riverTest.replace("'",' ')) print(riverTest) #3, p... 阅读全文
摘要:
l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [85,65,55] d = {'Michael':85,'Bob':65,'Tracy':55 阅读全文
摘要:
id = '511303199807040028'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')p 阅读全文
摘要:
import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle 阅读全文
摘要:
import turtle turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) tu 阅读全文
摘要:
number = 9 while True: guess = int(input('请猜一个数字\n')) if guess > number: input('猜的数字大了') elif guess < number: input('猜的数字小了') else: print('猜对了') break 阅读全文
摘要:
a=input('请输入华氏温度') sum2=int(a)*5/9-32 print('转换的摄氏温度是;{}'.format(sum2)) a=input('请输入摄氏温度') sum2=int(a)*5/9+32 print('转换的华氏温度是;{}'.format(sum2)) 阅读全文
摘要:
name1 = input('请输入一个名字:') name2 = input('再输入一个名字:') car = input('请输入一种车子:') print('练完铁头功的{}刚下山,就被{}开着带有电磁盘的{}吸走了'.format(name1,name2,car)) 阅读全文