2022年Python题库及答案
1.数据类型篇
本篇的练习题旨在考察你对基本数据类型的理解熟悉程度,适合刚接触python的初学者用来巩固对基础知
识的理解
1.1 基本数据类型
1.1.1 逻辑推理练习(类型转换)
不运行程序,说出下面程序的执行结果
1. 4.0 == 4
2. "4.0" == 4
3. bool("1")
4. bool("0")
5. str(32)
6. int(6.26)
7. float(32)
8. float("3.21")
9. int("434")
10. int("3.42")
11. bool(-1)
12. bool("")
13. bool(0)
14. "wrqq" > "acd"
15. "ttt" == "ttt "
16. "sd"*3
17. "wer" + "2322"
答案如下
1. True
2. False
3. True
4. True
5. '32'
6. 6
7. 32.0
8. 3.21
9. 434
10. 会报错
11. True
12. False
13. False
14. True
...
附件列表