Search Header Logo

Exploring Python Modules and Packages

Authored by John Chapman

Computers

11th Grade

Used 3+ times

Exploring Python Modules and Packages
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to import a module named `math` in Python?

`import math`

`include math`

`require math`

`use math`

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following commands is used to install a package using pip?

`pip install package_name`

`pip get package_name`

`pip fetch package_name`

`pip add package_name`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the `__init__.py` file in a Python package?

It initializes the package and can be used to execute package-level code.

It contains the main function of the package.

It is used to store package metadata.

It is used to list all modules in the package.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you import only the `sqrt` function from the `math` module?

`import math.sqrt`

`from math import sqrt`

`import sqrt from math`

`use math.sqrt`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a standard library in Python?

`numpy`

`pandas`

`os`

`requests`

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the command to list all installed packages using pip?

`pip list`

`pip show`

`pip display`

`pip packages`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If you have a module named `mymodule.py`, how would you import it in another Python script?

`import mymodule`

`include mymodule`

`require mymodule`

`use mymodule`

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?