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?

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

Quiz
•
Computers
•
Professional Development
•
Hard
Hoàng Cảnh
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
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()
Create a free account and access millions of resources
Similar Resources on Quizizz
10 questions
FP2: 07 - ARCHIVOS

Quiz
•
Professional Development
10 questions
SQL 3 LOWER()

Quiz
•
Professional Development
6 questions
Python VI

Quiz
•
Professional Development
5 questions
Cracking DP-203

Quiz
•
Professional Development
15 questions
Scope of Variables in Python

Quiz
•
1st Grade - Professio...
10 questions
CodeTigers Python 101

Quiz
•
KG - Professional Dev...
10 questions
02 - Python - Introduction & Installation

Quiz
•
University - Professi...
10 questions
Form - Input

Quiz
•
Professional Development
Popular Resources on Quizizz
15 questions
Multiplication Facts

Quiz
•
4th Grade
20 questions
Math Review - Grade 6

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
5 questions
capitalization in sentences

Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance

Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions

Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines

Quiz
•
Professional Development
12 questions
Dividing Fractions

Quiz
•
6th Grade