01-Check Yourself:Types and Operators
- Give the values printed by the following program for each of the labeled lines and answer the associated questions.
给出下面程序打印的每一行的值,并回答相关的问题。
a_float = 2.5
a_int = 7
b_int = 6
print(a_int / b_int) # Line 1
print(a_int // a_float) # Line 2
print(a_int % b_int) # Line 3
print(int(a_float)) # Line 4
print(float(a_int)) # Line 5
(a) Line 1: what is printed; what is its type?
(b) Line 2: what is printed; what is its type?
(c) Line 3: what is printed; what is its type?
(d) Line 4: what is printed; what is its type?
(e) Line 5: what is printed; what is its type?
(a)第一行:打印内容;它的类型是什么?
(b)第2行:打印的内容;它的类型是什么?
(c)第3行:打印内容;它的类型是什么?
(d)第4行:打印内容;它的类型是什么?
(e)第5行:打印的内容;它的类型是什么?
- Give the values printed by the following program for each of the labeled lines.
给出下面程序打印的每一行的值。
a_int = 10
b_int = 3
c_int = 2
print(a_int + b_int * c_int) # Line 1
print( (a_int + b_int) * c_int ) # Line 2
print(b_int ** c_int) # Line 3
print(0o10 + c_int) # Line 4
(a) What is printed by Line 1?
(b) What is printed by Line 2?
(c) What is printed by Line 3?
(d) What is printed by Line 4?
(a) 1号行打印什么?
(b) 2号行打印什么?
(c)第3行打印什么?
(d)第4行打印了什么?
公众号:AI悦创【二维码】

AI悦创·编程一对一
AI悦创·推出辅导班啦,包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发,华为 Python 机试」,全部都是一对一教学:一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然,还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线,随时响应!微信:Jiabcdefh
C++ 信息奥赛题解,长期更新!长期招收一对一中小学信息奥赛集训,莆田、厦门地区有机会线下上门,其他地区线上。微信:Jiabcdefh
方法一:QQ
方法二:微信:Jiabcdefh
