
Module and package in Python
Quiz by Phuong Do Thi
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
10 questions
Show answers
- Q1Trong Python, import module dùng để làm gì?Import module được sử dụng để tạo ra module mới.Import module được sử dụng để thêm chức năng và code từ một file khác vào chương trình hiện tại.Import module được sử dụng để chỉnh sửa chương trình hiện tại.Import module được sử dụng để chạy chương trình từ đầu.30s
- Q2Trong Python, package là gì?Package là một cách để chạy chương trình từ đầu.Package là một cách để tạo ra module mới.Package là một cách để chỉnh sửa chương trình hiện tại.Package là một cách để tổ chức, quản lý và phân chia các module liên quan đến nhau.30s
- Q3Trong Python, để import tất cả các function từ một module, chúng ta sử dụng cú pháp nào?import * from moduleimport module.*from module import *30s
- Q4Trong Python, để import một module hoặc package từ một đường dẫn cụ thể, chúng ta sử dụng cú pháp nào?import package.modulefrom module import *from package import *
import sys
sys.path.append('duong_dan')
import module
30s - Q5Trong Python, để import một module và đặt tên rút gọn cho nó khi sử dụng, chúng ta sử dụng cú pháp nào?import module_name alias_nameimport * from module_nameimport module_name as alias_namefrom module_name import *30s
- Q6Trong Python, khi import module, nếu module không tồn tại, lỗi nào sẽ xảy ra?Lỗi TypeErrorLỗi SyntaxErrorLỗi ImportErrorLỗi ValueError30s
- Q7Trong Python, để import một module và chỉ import một số function cụ thể từ đó, chúng ta sử dụng cú pháp nào?from module import *import * from moduleimport module as aliasfrom module import function1, function230s
- Q8Trong Python, để import một module từ một subpackage bên trong một package, chúng ta sử dụng cú pháp nào?import package.subpackagefrom subpackage import *import * from subpackagefrom package.subpackage import module30s
- Q9
Nối câu lệnh import với câu lệnh gọi hàm tương ứng
Users link answersLinking30s - Q10
Phát biểu sau đúng hay sai?
Phải import module nhiều lần trong chương trình bất kỳ khi nào cần sử dụng
falsetrueTrue or False30s