题目内容

{下面代码的输出结果是:for s in“HelloWorld”:(缩进)if s==”W”: (继续缩进)Continue(缩进减少)print(s,end=””)}

A. Helloorld
B. Hello
C. HelloWorld
D. World

查看答案
更多问题

关于Python循环结构,以下选项中描述错误的是:

A. 每个continue语句只有能力跳出当前循环
B. 遍历循环中的遍历结构可以是字符串、文件、组合数据类型和range()函数等
C. break用来跳出最内层for或者while循环,脱离该循环后程序从循环代码后继续执行
D. Python通过for、while等保留字提供循环结构

{下面代码的输出结果是:for s in“HelloWorld”:(缩进)if s==”W”: (继续缩进) break(缩进)print(s,end=””)}

A. Helloorld
B. World
C. Hello
D. HelloWorld

{下面代码的输出结果是:s=1.0for num in range(1,4):(缩进)s += numprint(s)}

A. 6
B. 7.0
C. 1.0
D. 7

{下面代码的输出结果是:fori in range(10):(缩进)if i%2 == 0 : (继续缩进) Coninue(缩进)else: (继续缩进) print(i,end=’,’)}

A. 1,3,5,7,9,
B. 0,2,4,6,8,
C. 0,2,4,6,8,10,
D. 2,4,6,8,

答案查题题库