單項選擇題在Python中,如何定義無限循環(huán)?()

A.while True
B.for _in infinite
C.loop:continue
D.goto start


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題在Python中,哪個符號用于格式化字符串?()

A.%
B..format
C.f-string
D.所有以上的選項

2.單項選擇題在Python中,如何定義一個不做任何事的函數?()

A.def func():pass
B.def func():void
C.def func():None
D.def func():continue

3.單項選擇題在Python中,如何使用類屬性?()

A.ClassName.attribute
B.self.attribute
C.obj.attribute
D.B和C都對

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

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

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

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