单选题 在Python中,定义函数需要使用关键字:

A、 def # class
B、 define
C、 ifdef
D、 ifndef
下载APP答题
由4l***ve提供 分享 举报 纠错

相关试题

单选题 Python 中,使用哪个关键字退出while循环:

A、break
B、continue
C、if
D、quit

单选题 Python 如何定义一个函数 :( )

A、 class <name>(<type> arg1,<type> arg2, ⋯<type> argN)
B、 function <name>(arg1,arg2, ⋯ argN)
C、 def <name>(arg1,arg2, ⋯argN)
D、 def <name>(<type> arg1,<type> arg2, ⋯ <type> argN)

单选题 以下不能创建一个字典的语句是 ( )

A、 dic1 = {}
B、 dic2 = {123:345}
C、 dic3 = {[1,2,3]:'uestc'}
D、 dic3 = {(1,2,3):'uestc'}

单选题 在Python中,numbers=[1, 2, 3, 4, 5],执行print(numbers[:4])的结果为( )

A、[4]
B、[5]
C、[1,2,3, 4]
D、[1,2,3,4,5]

单选题 在Python中,可以在列表的任何位置添加新元素的方法是( )

A、append()
B、insert()
C、strcat()
D、strcpy()

单选题 Python 中,向列表的指定位置插入元素,需要使用:

A、add
B、set
C、insert .
D、lpush"

单选题 Python中, 在列表users 尾部添加元素"tom",写法正确的是( )

A、users.add("tom")
B、users.append("tom")
C、users.set("tom")
D、users.rpush("tom")

单选题 在Python中,遍历字典中的所有键,可以使用( )

A、keys()
B、values()
C、items()
D、all()