單項(xiàng)選擇題在Python中,如何使用函數(shù)作為參數(shù)?()

A.def func(f):f()
B.func =(function)=>function()
C.func(function:function())
D.function(func)


您可能感興趣的試卷

你可能感興趣的試題

1.單項(xiàng)選擇題在Python中,如何使用生成器生成一個(gè)數(shù)列?()

A.(x for x in range(10))
B.[x for x in range(10)]
C.generator(x for x in range(10))
D.yield(x for x in range(10))

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

A.str.replace(char,’’)
B.str.remove(char)
C.str.delete(char)
D.del str[char]

3.單項(xiàng)選擇題在Python中,如何獲取列表的長度?()

A.len(list)
B.list.length()
C.list.size()
D.list.len()

4.單項(xiàng)選擇題在Python中,如何創(chuàng)建一個(gè)自定義異常?()

A.class MyException(Exception):pass
B.create Exception(’MyException’)
C.exception MyException
D.new Exception(’MyException’)

5.單項(xiàng)選擇題在Python中,如何使用正則表達(dá)式匹配一個(gè)字符串?()

A.re.match(pattern,string)
B.string.match(pattern)
C.pattern.match(string)
D.regex.match(string,pattern)