题目内容

下列对逻辑运算符描述错误的是()。

A. 执行x and y,如果x为False,y为True,结果为False
B. 执行x or y,如果x为False,y为True,结果为True
C. 逻辑运算符and or not,遵循书写顺序从左到右执行
D. 执行x and not y,如果x为True,y为False,结果为True

查看答案
更多问题

已知变量str='i love 99onez',编写代码,是的运行结果不能输出3次'i love 99onez'的选项是( )

A. print(str+str+str)
B. print(str,str,str)
C. i=0 while i<3: i=i+l print(str)
D. i=0 while i<3: print(str) i=i+1

下列程序无法正常运行的是()。

A. i=0 while i<=5: i=i+l if i==2: continue print('hello python1)
B. i=0 while i<=5: continue print(‘hello python’) i=i+1
C. i=0 while i<=5: print('hello python') i=i+1
D. i=0 while i<=5: i =i+l print('hello python')

下列关于continue和break语句描述错误的是()。

A. continue和break都在循环中使用
B. continue是跳岀本次循环,执行下一次循环
C. 两者都在循环中使用,用于结束循环,程序终止
D. 如果程序中只存在循环,并且是单循环,break是结束循环,程序终止。在多层循环嵌套中,break只结束当前循环

下列代码中,哪一段代码使死循环()。

A. while 4: print(“Python”)
B. while not
C. print(“I love Python”)
D. if not 5 and 0: print(“Python”)
E. print(“Pthon”)

答案查题题库