题目内容

代码 def a(b, c, d): pass 含义是?

A. 定义一个列表,并初始化它。
B. 定义一个函数,但什么都不做。
C. 定义一个函数,并传递参数。
D. 定义一个空的类。

查看答案
更多问题

以下哪个关键字是与 try 语句一起使用来处理异常的?

A. catch
B. exception
C. catch(a)
D. except

以下哪个代码是正确的读取一个文件?

A. f = open("test.txt","read")
B. f = open("r", "test.txt")
C. f = open("test.txt","r")
D. f = open("read","test.txt")

以下哪个代码是正确的打开文件并准备写入?

A. f = open("test.txt", "w")
B. f = open("test.txt", "write")
C. f = open("write", "test.txt")
D. f = open("w", "test.txt")

Python 中,以下哪个代码是正确的字典?

A. myexample = {'someItem'=>2, 'otherItem'=>20}
B. myexample = {'someItem':2, 'otherItem':20}
C. myexample = ('someItem'=>2, 'otherItem'=>20)
D. myexample = ('someItem'=>2, 'otherItem'=>20)

答案查题题库