摘要:
#1. hryFile = open('hry.txt',mode='r',encoding='utf-8') hryText = hryFile.read() hryFile.close() print(hryText) #2. replaceList = [',',"'",'-','\n'] for c in replaceList: hryText = hryText.repla... 阅读全文
摘要:
def hanoi(n,a,b,c): if n==1: print(n,a+'->'+c) else: hanoi(n-1,a,c,b) print(n,a+'->'+c) hanoi(n-1,b,a,c) hanoi(6,'A','B','C') 阅读全文
摘要:
l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,65,45] d = {'Michael':95,'Bob':65,'Tracy':45 阅读全文
摘要:
fr = open('letter.txt',mode='r',encoding='utf-8') plaincode = fr.read() print('明文:'+ plaincode) print('密文',end='') for c in plaincode: print(chr(ord(c 阅读全文
摘要:
stuNum = '201709090003' print('年级是:'+stuNum[0:4]) print('专业编号是:'+stuNum[4:9]) print('序号是:'+stuNum[-3:]) IDNo= '440802199707180017' print('省市是:'+IDNo[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 阅读全文
摘要:
import turtle #画一个五角星 turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward(100) turtle.right(144) turtle.forward 阅读全文
摘要:
while True: guess = int(input()) if guess > myNumber: print('>') elif guess >> 3>2 True >>> 3==2 False >>> 3>> 阅读全文
摘要:
a=input('请输入华氏温度') sum2=int(a)*5/9-32 print('转换的摄氏温度是;{}'.format(sum2)) a=input('请输入摄氏温度') sum2=int(a)*5/9+32 print('转换的华氏温度是;{}'.format(sum2)) 阅读全文