Exploring Python Modules and Packages

Exploring Python Modules and Packages

11th Grade

15 Qs

quiz-placeholder

Similar activities

Coding and Robotics

Coding and Robotics

8th - 12th Grade

12 Qs

10 CS // Pseudocode

10 CS // Pseudocode

9th - 11th Grade

10 Qs

Dates in python

Dates in python

2nd Grade - Professional Development

12 Qs

class 11 - basic concepts in python 1

class 11 - basic concepts in python 1

11th Grade

19 Qs

Знакомство с IDLE 6 класс

Знакомство с IDLE 6 класс

6th Grade - University

15 Qs

Python Selection Statements

Python Selection Statements

11th Grade

10 Qs

Test on Python Function

Test on Python Function

11th - 12th Grade

12 Qs

Python Revision 3

Python Revision 3

11th - 12th Grade

13 Qs

Exploring Python Modules and Packages

Exploring Python Modules and Packages

Assessment

Quiz

Computers

11th Grade

Medium

Created by

John Chapman

Used 3+ times

FREE Resource

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`

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?