摘要:
#1. bigFile = open('big.txt',mode='r',encoding='utf-8') bigText=bigFile.read() bigFile.close() print(bigText) #2. replaceList=[',','.',"'",'\n'] for c 阅读全文
摘要:
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(8,'A','B','C') 阅读全文
摘要:
l = ['Michael','Bob','Tracy'] l.append('Bob') l.pop() print(1) t = ('Michael','Bob','Tracy') scores = [95,85,75] d = {'Michael':95,'Bob':85,'Tracy':75} d['Bob'] = 82 d['Rose'] = 88 d.pop('Bob') p. 阅读全文
摘要:
id= '440404199810072828' 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') for i in range(12): print(9... 阅读全文
摘要:
import turtle turtle.setup(600,400,0,0) turtle.bgcolor('red') turtle.color('yellow') turtle.fillcolor('yellow') def mygoto(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown() def dra... 阅读全文
摘要:
import turtle # 设置初始位置 turtle.penup() turtle.left(90) turtle.fd(200) turtle.pendown() turtle.right(90) # 花蕊 turtle.fillcolor("red") turtle.begin_fill() turtle.circle(10, 180) turtle.circle(25, ... 阅读全文
摘要:
myNumber = 7 while True: guess = int(input('请输入一个数量:')) if guess > myNumber: print('输入的数量过大') elif guess < myNumber: print('输入的数量过小') else: print('输入的 阅读全文
摘要:
a=input('请输入摄氏温度') sum2=int(a)*5/9+32 print('转换的摄氏度是:{}'.format(sum2)) a=input('请输入华氏温度') sum2=int(a)*5/9-32 print('转换的摄氏温度是;{}'.format(sum2)) 阅读全文
摘要:
请输入摄氏温度5 转换的摄氏度是:34.77777777777778 >>> 阅读全文
摘要:
== RESTART: C:/Users/teacher/AppData/Local/Programs/Python/Python36-32/2.py == 请输入一个名字: == RESTART: C:/Users/teacher/AppData/Local/Programs/Python/Python36-32/2.py == 请输入一个名字:鹿晗 再输入一个名字:屁屁 请输入一辆车:兰博基... 阅读全文