單項選擇題在Python中,如何向一個列表的末尾添加元素?()

A.list.append(item)
B.list.add(item)
C.list.insert(len(list),item)
D.A和C都對


您可能感興趣的試卷

你可能感興趣的試題

2.單項選擇題在Python中,如何捕獲所有異常?()

A.except Exception as e
B.catch all
C.except
D.try catch

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

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

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

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

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

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