單項(xiàng)選擇題在Python中,如何獲取當(dāng)前日期?()

A.datetime.date.today()
B.date.current()
C.now.date()
D.date.today()


您可能感興趣的試卷

你可能感興趣的試題

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

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

2.單項(xiàng)選擇題在Python中,如何使用生成器生成一個數(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))

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

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

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

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

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

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