题目内容

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

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)

以下哪个代码是将字符串转换为浮点数?

A. int(x [,base])
B. long(x [,base])
C. float(x)
D. str(x)

以下哪个 if 语句是正确的?

A. if a >= 22:
B. if (a >= 22)
C. if (a => 22)
D. if a >= 22

以下哪个关键字是用于给 if 语句添加其他条件语句的?

A. else if
B. elseif
C. elif
D. 以上都不是

答案查题题库