單項(xiàng)選擇題在Python中,如何在列表中插入元素?()

A.list.add(index,element)
B.list.append(element)
C.list.insert(index,element)
D.C和B都對(duì)


您可能感興趣的試卷

你可能感興趣的試題

1.單項(xiàng)選擇題在Python中,如何查找字符串中的子串?()

A.str.index(sub)
B.str.find(sub)
C.str.search(sub)
D.A和B都對(duì)

2.單項(xiàng)選擇題在Python中,如何從字符串中刪除特定字符?()

A.str.replace(char,’’)
B.str.remove(char)
C.str.strip(char)
D.A和C都對(duì)

3.單項(xiàng)選擇題在Python中,如何返回函數(shù)的多個(gè)值?()

A.returnA ,b
B.return (a,b)
C.return [a,b]
D.A和B都對(duì)

4.單項(xiàng)選擇題在Python中,如何執(zhí)行一個(gè)外部命令?()

A.os.system(command)
B.subprocess.run(command)
C.exec(command)
D.A和B都對(duì)

5.單項(xiàng)選擇題在Python中,如何判斷兩個(gè)字符串是否相等?()

A.str1==str2
B.str1.equals(str2)
C.str1.isEqual(str2)
D.str1.compare(str2)