题目内容

{下面代码的输出结果是:s = 0for i in range(5):(缩进)s = s + iprint(s)}

A. 10
B. 15
C. 0
D. 9

查看答案
更多问题

{下面代码的输出结果是:str=””for s in“abc”:(缩进)str += s*2print(s)}

A. abc
B. abc*2
C. aabbcc
D. a*2b*2c*2

{下面代码的输出结果是: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

答案查题题库