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

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


您可能感興趣的試卷

你可能感興趣的試題

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

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

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

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

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

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

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

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

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

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