1 1. 2 count=1 3 while count<11: 4 fen=input('请第{}个评委打分' .format( count)) 5 if int(fen) >5 and int(fen) <10: 6 print("评分有效") 7 else: 8 continue 9 count+=1 10 2. 11 lst=['西游记','水浒传','红楼梦','笑傲江湖'] 12 dic={} 13 for i in lst: 14 fen=int(input("给{}打分:".format(i))) 15 dic[i]=fen 16 print(dic) 17 18 3. 19 dic={ 20 '-':'fu', 21 '0':'ling', 22 '1':'yi', 23 "2":'er', 24 '3':'san', 25 '4':'si', 26 '5':'wu', 27 '6':'liu', 28 '7':'qi', 29 '8':'ba', 30 '9':'jiu', 31 '10':'10' 32 } 33 a=input("输入数字:") 34 for i in a: 35 print(dic[i],end=' ') 36 37 4. 38 car=['鲁A3569','鲁B5698','京A36985','黑D3695','黑A3694','沪B3598','沪A3695'] 39 local={'鲁':'山东','黑':'黑龙江','沪':'上海','京':'北京'} 40 a=[] 41 b={} 42 for i in car: 43 b[local[i[0]]]=0 44 a.append(local[i[0]]) 45 for j in b: 46 b[j]=a.count(j) 47 print(b) 48 5. 49 lst=[] 50 sum=0 51 zhubo={'卢本伟':1236,'冯提莫':4255,'利哥':4569} 52 for v in zhubo.values(): 53 sum=sum+v 54 avg=sum/len(zhubo) 55 print(avg) 56 for k,v in zhubo.items(): 57 if v<avg: 58 lst.append(k) 59 for i in lst: 60 zhubo.pop(i) 61 print(zhubo)