-->
当前位置:首页 > 题库 > 正文内容

填空题:字典的成员函数(高教社,《Python编程基础及应用》习题7-3)

Luz3年前 (2022-06-27)题库867
字典的成员函数(高教社,《Python编程基础及应用》习题7-3)
<br>

请写出下述程序的执行结果:

python
stu = {"name":"Eric Zhang","english":80,"python":90,"math":100}
print(len(stu))
print(stu["name"])
print(list(stu.keys()))
print("math" in stu)
print(stu["math"]+10)
print(stu["math"])
print(list(stu.items())[1])
print(list(stu.values())[2])


第1行:
<br>第2行:
<br>第3行:
<br>第4行:
<br>第5行:
<br>第6行:
<br>第7行:
<br>第8行:

<br>**拼尽全力还是不会?参考B站习题讲解**<br>哔哩哔哩up主:[海洋饼干叔叔](https://space.bilibili.com/384177380) [Python课程](https://www.bilibili.com/video/BV1kt411R7uW/) [Python习题](https://www.bilibili.com/video/BV1iL411t7UZ/)[简洁的C和C++](https://www.bilibili.com/video/BV1it411d7zx/)作者每天分享一篇关于C/C++/Python的技术文章,学习编程不迷路。![image.png](~/7c4cfd2d-8e3e-40cd-826d-299d4200e600.png)







答案:
第1空:4 ||

第2空:Eric Zhang ||

第3空:['name', 'english', 'python', 'math'] || ['name','english','python','math'] ||

第4空:True ||

第5空:110 ||

第6空:100 ||

第7空:('english', 80) || ('english',80) ||

第8空:90 ||

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。