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

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


您可能感興趣的試卷

你可能感興趣的試題

1.單項(xiàng)選擇題在Python中,如何使用三元運(yùn)算符?()

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

2.單項(xiàng)選擇題在Python中,如何判斷一個(gè)變量是否為None?()

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

3.單項(xiàng)選擇題在Python中,如何合并兩個(gè)字典?()

A.dict1.update(dict2)
B.dict1+dict2
C.dict1.merge(dict2)
D.dict1&&dict2

4.單項(xiàng)選擇題在Python中,如何創(chuàng)建一個(gè)只讀屬性?()

A.@property
B.readonly
C.const
D.immutable

5.單項(xiàng)選擇題在Python中,如何刪除字符串的前后空格?()

A.str.strip()
B.str.trim()
C.strip(str)
D.trim(str)