placeholder image to represent content

Module and package in Python

Quiz by Phuong Do Thi

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
10 questions
Show answers
  • Q1
    Trong 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
  • Q2
    Trong 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
  • Q3
    Trong 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 module
    import module.*
    from module import *
    30s
  • Q4
    Trong 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.module
    from module import *
    from package import *

    import sys

    sys.path.append('duong_dan')

    import module

    30s
  • Q5
    Trong 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_name
    import * from module_name
    import module_name as alias_name
    from module_name import *
    30s
  • Q6
    Trong Python, khi import module, nếu module không tồn tại, lỗi nào sẽ xảy ra?
    Lỗi TypeError
    Lỗi SyntaxError
    Lỗi ImportError
    Lỗi ValueError
    30s
  • Q7
    Trong 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 module
    import module as alias
    from module import function1, function2
    30s
  • Q8
    Trong 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?
    Question Image
    import package.subpackage
    from subpackage import *
    import * from subpackage
    from package.subpackage import module
    30s
  • Q9

    Nối câu lệnh import với câu lệnh gọi hàm tương ứng

    Users link answers
    Linking
    30s
  • 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 

    false
    true
    True or False
    30s

Teachers give this quiz to your class