题目内容

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

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

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

答案查题题库