以下哪个代码是正确的打开文件并准备写入?
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