python day05 作业答案】的更多相关文章

1. b.不可以 c.tu=("alex",[11,22,{"k1":"v1","k2":["age","name"],"k3":(11,22,33)},44]) tu[1][2]["k2"].append("Seven") print(tu) d.tu[1][2]["k3"] 不可以 2. dic={&qu…
2.def func(*args): sum = 0 for i in args: sum=sum+int(i) return sum a=func(2,3,9,6,8) print(a) 3. a=10 b=20 def test5(a,b): print(a,b) c=test5(b,a) 4. a=10 b=20 def test5(a,b): a=3 b=5 print(a,b) c=test5(b,a) print(c) 5. def func(*args): return args…
2. def lst(input): lst2=[] count=0 for i in range(0,len(input)): if i %2!=0: lst2.append(input[i]) return lst2 a=lst((2,9,29,36,9)) print(a) 3. def pd(input): if len(input)>5: return True else: return False a=pd((5,5,6,9,7)) print(a) 4. def a(input):…
1. a f=open('11.txt','r',encoding='utf-8') a=f.read() print(a) f.flush() f.close() b. f=open('11.txt','a',encoding='utf-8') f.write('信不信由你') f.flush() f.close() c. f=open('11.txt','r+',encoding='utf-8') a=f.read() print(a) f.write('信不信由你') f.flush()…
1. sum=0 a=input() for i in a: sum=sum+int(i)**3 if sum==int(a): print('水仙数') 2. lst=[100,2,6,9,1,10,12,35,1,9,65,8,100,0,1,9,5,6]count=0while count<len(lst): for i in range(0, len(lst) - 1): if lst[i] > lst[i + 1]: lst[i ], lst[i+1] = lst[i+1], lst…
1. count=1 while count<11: fen=input('请第{}个评委打分' .format( count)) if int(fen) >5 and int(fen) <10: print("评分有效") else: continue count+=1 2. lst=['西游记','水浒传','红楼梦','笑傲江湖'] dic={} for i in lst: fen=int(input("给{}打分:".format(i)))…
1. 1) li=['alex','WuSir','ritian','barry','wenzhou'] print(len(li)) 2) li=['alex','WuSir','ritian','barry','wenzhou'] li.append('seven') print(li) 3) li=['alex','WuSir','ritian','barry','wenzhou'] li.insert(1,'Tony') print(li) 4) li=['alex','WuSir','…
1. (1).false   (2).false 2. (1).8  (2).4 3. (1).6  (2).3  (3).false (4).3   (5).true   (6).true  (7).0  (8).3  (9).0 (10).2 4. (1).while True: 循环体 else: 跳出循环执行这里 5. count=1 while 1: number=input("猜猜我的数字:") if int(number)==66: print("回答正确&qu…
My way to Python - Day05 - 面向对象   思维导图…