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 day06 作业答案的更多相关文章
- python day10作业答案
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= ...
- python day09作业答案
2. def lst(input): lst2=[] count=0 for i in range(0,len(input)): if i %2!=0: lst2.append(input[i]) r ...
- python day08作业答案
1. a f=open('11.txt','r',encoding='utf-8') a=f.read() print(a) f.flush() f.close() b. f=open('11.txt ...
- python day07作业答案
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 ...
- python day05 作业答案
1. b.不可以 c.tu=("alex",[11,22,{"k1":"v1","k2":["age" ...
- python day04 作业答案
1. 1) li=['alex','WuSir','ritian','barry','wenzhou'] print(len(li)) 2) li=['alex','WuSir','ritian',' ...
- python day02 作业答案
1. (1).false (2).false 2. (1).8 (2).4 3. (1).6 (2).3 (3).false (4).3 (5).true (6).true (7) ...
- 笔试 - 高德软件有限公司python问题 和 答案
高德软件有限公司python问题 和 答案 本文地址: http://blog.csdn.net/caroline_wendy/article/details/25230835 by Spike 20 ...
- C#基础第九天-作业答案-储蓄账户(SavingAccount)和信用账户(CreditAccount)
class Bank { //Dictionary<long,Account> dictionary=new Dictionary<long,Account>(); DataT ...
随机推荐
- 第三周学习进度条+PSP0过程文档
第三周学习进度条 第三周 所花时间(包括上课) 14:30-15:35(65)+19:00-21:20(140)+17:52-19:00(68)+19:10-20:45(95)+21:00-22 ...
- leetcode-algorithms-13 Roman to Integer
leetcode-algorithms-13 Roman to Integer Roman numerals are represented by seven different symbols: I ...
- windows7安装教程(vmware)
这步是正确安装windows的关键,如果不设置那么安装时将不能识别出磁盘,造成安装不成功. 选择No进行自定义修饰,主要是保证C盘大小合适,其他盘可在安装完成之后再调整. 后续安装步骤全自动,完全不用 ...
- linux command mktemp
Linux command mktemp [Purpose] Learning linux command mktemp to create a temporary file or di ...
- QuickStart系列:docker部署之Mysql
这里配置只做开发用,生产环境请根据需要修改或自行搜索其他说明 使用docker安装mysql,目前版本5.7.4(当前时间 2018.1.11) 环境 vm: Centos7 镜像来源 https:/ ...
- POJ 1035 Spell checker 字符串 难度:0
题目 http://poj.org/problem?id=1035 题意 字典匹配,单词表共有1e4个单词,单词长度小于15,需要对最多50个单词进行匹配.在匹配时,如果直接匹配可以找到待匹配串,则直 ...
- Java压缩文件
压缩文件 package com.iss.cpf.windmanger.userprivilegeexport.bizlogic; import java.io.BufferedInputStream ...
- python 学习笔记 字符串和编码
字符编码:因为计算机只能处理数字,如果要处理文本,就必须先把文本转换为数字才能处理,最早的计算机在设计时采用8个比特(bit)作为一个字节 (byte),所以,一个字节能表示的最大的整数是255(二进 ...
- OOP⑶
/** * 学生类 * ctrl+o 查询本类的所有属性 和方法 */ public class Student { int age; // 年龄 String name; // 姓名 // 自己创建 ...
- nginx;keepalived配置出现主主的解决方法(脑裂问题)
1.查看日志 tail -f /var/log/messages 发现master和backup机都是mastaer模式启动的 通过查看别人的经历,发现VRRP基于报文实现的.master设置一定时间 ...