單項選擇題在Python中,如何將一個字符串反轉(zhuǎn)?()

A.str[::-1]
B.str.reverse()
C.reverse(str)
D.reversed(str)


您可能感興趣的試卷

你可能感興趣的試題

1.單項選擇題在Python中,如何創(chuàng)建一個子類?()

A.class SubClass(SuperClass):pass
B.class SubClass inherits SuperClass
C.class SubClass:super(SuperClass)
D.class SubClass ->SuperClass

2.單項選擇題在Python中,如何從JSON字符串中解析一個字典?()

A.json.loads(json_str)
B.json.parse(json_str)
C.dict.fromJSON(json_str)
D.parseJSON(json_str)

3.單項選擇題在Python中,如何將一個字典轉(zhuǎn)換為JSON字符串?()

A.json.dumps(dict)
B.dict.toJSON()
C.json.stringify(dict)
D.dict.toString()

4.單項選擇題在Python中,如何復制一個列表?()

A.list.copy()
B.copy(list)
C.list[:]
D.A和C都對

5.單項選擇題在Python中,如何獲取一個函數(shù)的名稱?()

A.function.__name__
B.function.getName()
C.functionName(function)
D.function.name()