單項選擇題在Python中,如何向一個已存在的文件中寫入數(shù)據(jù)?()

A.open(file,’a’)
B.open(file,’w’)
C.open(file,’r+’)
D.A和C都對


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題在Python中,如何將一個字符串分割成列表?()

A.str.split(sep)
B.str.divide(sep)
C.split(str,sep)
D.list(str,sep)

2.單項選擇題在Python中,如何判斷一個列表是否為空?()

A.len(list)==0
B.list.isEmpty()
C.not list
D.A和C都對

3.單項選擇題在Python中,如何獲取字符串的子串?()

A.str[start:end]
B.str.sub(start,end)
C.str.slice(start,end)
D.str.substring(start,end)

4.單項選擇題在Python中,如何使用三元運算符?()

A.x if condition else y
B.condition ?x :y
C.if condition then x else y
D.condition ->x,y

5.單項選擇題在Python中,如何判斷一個變量是否為None?()

A.var is None
B.var ==None
C.var.isNull()
D.A和B都對