《Python程序设计题库》第 3 章:选择结构与循环结构

239、表达式 'ab' in 'acbed' 的值为____。(False)

240、假设n为整数,那么表达式 n&1 == n%2 的值为_____。(True)

241、关键字__用于测试一个对象是否是一个可迭代对象的元素。(in)

242、表达式 3<5>2 的值为___。(True)

243、已知 x = {'a':'b', 'c':'d'},那么表达式 'a' in x 的值为__。(True)

244、已知 x = {'a':'b', 'c':'d'},那么表达式 'b' in x 的值为__。(False)

245、已知 x = {'a':'b', 'c':'d'},那么表达式 'b' in x.values() 的值为__。(True)

246、表达式 1<2<3 的值为_____。(True)

247、表达式 3 or 5 的值为____。(3)

248、表达式 0 or 5 的值为_____。(5)

249、表达式 3 and 5 的值为____。(5)

250、表达式 3 and not 5 的值为__。(False)

251、Python中用于表达逻辑与、逻辑或、逻辑非运算的关键字分别是_、___、_____。(and、or、not)

252、Python 3.x语句 for i in range(3):print(i, end=',') 的输出结果为_____。(0,1,2,)

253、Python 3.x语句 print(1, 2, 3, sep=',') 的输出结果为____。(1,2,3)

254、对于带有else子句的for循环和while循环,当循环因循环条件不成立而自然结束时____(会?不会?)执行else中的代码。(会)

255、在循环语句中,__语句的作用是提前结束本层循环。(break)

256、在循环语句中,___语句的作用是提前进入下一次循环。(continue)

257、表达式 5 if 5>6 else (6 if 3>2 else 5) 的值为_____。(6)

258、Python关键字elif表达__和___两个单词的缩写。(else、if)

259、表达式 3 in {1, 2, 3} 的值为_____。(True)

260、表达式 'ac' in 'abce' 的值为_____。(False)

261、表达式 not 3 的值为____。(False)