填空题:字典的成员函数(高教社,《Python编程基础及应用》习题7-3)
字典的成员函数(高教社,《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的技术文章,学习编程不迷路。
答案:
第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 ||
<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的技术文章,学习编程不迷路。
答案:
第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 ||