python day06 作业答案

 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)))
dic[i]=fen
print(dic) 3.
dic={
'-':'fu',
'':'ling',
'':'yi',
"":'er',
'':'san',
'':'si',
'':'wu',
'':'liu',
'':'qi',
'':'ba',
'':'jiu',
'':''
}
a=input("输入数字:")
for i in a:
print(dic[i],end=' ') 4.
car=['鲁A3569','鲁B5698','京A36985','黑D3695','黑A3694','沪B3598','沪A3695']
local={'鲁':'山东','黑':'黑龙江','沪':'上海','京':'北京'}
a=[]
b={}
for i in car:
b[local[i[0]]]=0
a.append(local[i[0]])
for j in b:
b[j]=a.count(j)
print(b)
5.
lst=[]
sum=0
zhubo={'卢本伟':1236,'冯提莫':4255,'利哥':4569}
for v in zhubo.values():
sum=sum+v
avg=sum/len(zhubo)
print(avg)
for k,v in zhubo.items():
if v<avg:
lst.append(k)
for i in lst:
zhubo.pop(i)
print(zhubo)
上一篇:python day07作业答案


下一篇:python day05 作业答案