单选题 以下哪个代码片段可以正确地判断一个变量age是否大于18且小于65?

A、 if age > 18 or age < 65:
B、 if age > 18 < 65:
C、 if 18 < age < 65:
D、 if age > 18 and age < 65:
下载APP答题
由4l***9u提供 分享 举报 纠错

相关试题

单选题 使用( )符号对浮点类型的数据进行格式化。

A、%c
B、%d
C、%f
D、%s

单选题 下列选项中,哪个不是Python读文件的方法( )。

A、read()
B、readline()
C、readlines()
D、readtext()

单选题 13&9的结果是( )。

A、9
B、13
C、0
D、1

单选题 类方法是类所拥有的方法,需要用修饰器( )来标识其为类方法。

A、@classmethod
B、@classfunction
C、@staticmethod
D、@instancemethod

单选题 假设要随机删除字典中的“键-值”对,该用下列哪个方法( )。

A、pop
B、popitem
C、del
D、clear

单选题 下列哪个不是Python中有效的字符串表示方法?

A、'Hello, World!'
B、abc
C、"Multi-line string"
D、"Python"

单选题 下列方法中,可用于向文件中写入内容的是( )。

A、open()
B、read()
C、write()
D、close()

单选题 下列函数中,用于返回元组中元素最小值的是( )。

A、len()
B、min()
C、max()
D、range()