题目内容

分支语句的基本形式是()。

A. if 判断条件 条件成立时执行的语句块 else: 条件不成立时执行的语句块
B. if判断条件 条件成立时执行的语句块 else 条件不成立时执行的语句块
C. if 判断条件: 条件成立时执行的语句块 else: 条件不成立时执行的语句块
D. if 判断条件: 条件成立时执行的语句块 else:

查看答案
更多问题

关于python中的逻辑运算符的优先级比较,下列选项正确的是()。

A. not>and=or
B. not
C. not>and>or
D. not=and>or

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

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')

答案查题题库