Search Header Logo

Kiểm tra về mô-đun datetime trong Python

Authored by Hoàng Cảnh

Computers

Professional Development

Kiểm tra về mô-đun datetime trong Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Làm thế nào để lấy ra thời gian ngày và giờ hiện tại trong Python sử dụng mô-đun datetime?

datetime.datetime.now()

datetime.date.today()

datetime.time()

datetime.timedelta()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lớp nào trong mô-đun datetime đại diện cho thời gian cục bộ?

Lớp date

Lớp time

Lớp timedelta

Lớp datetime

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Làm thế nào để tạo một đối tượng date chứa ngày hiện tại trong Python?

date.today()

date.present()

date.now()

date.current()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Làm thế nào để lấy ra thời gian giờ, phút, giây và mili giây từ một đối tượng time trong Python?

a.h, a.m, a.s, a.ms

a.hh, a.mm, a.ss, a.ms

a.hours, a.minutes, a.seconds, a.milliseconds

a.hour, a.minute, a.second, a.microsecond

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Lớp nào trong mô-đun datetime có thể chứa thông tin từ cả hai đối tượng date và time?

Lớp date

Lớp time

Lớp datetime

Lớp timedelta

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Làm thế nào để tính sự chênh lệch giữa hai khoảng thời gian ngày và giờ trong Python?

t1 / t2

t1 * t2

t1 + t2

t1 - t2

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Làm thế nào để tính tổng số giây trong một đối tượng timedelta trong Python?

t.count_seconds()

t.sum_seconds()

t.total_seconds()

t.get_seconds()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?