Module in Python

Module in Python

University

15 Qs

quiz-placeholder

Similar activities

Game sobre funções em Python

Game sobre funções em Python

University

10 Qs

2. Ayo Main Quiz Lagi

2. Ayo Main Quiz Lagi

University - Professional Development

20 Qs

[PYTHON] Django

[PYTHON] Django

University

15 Qs

django basics

django basics

University

12 Qs

Pemahaman Virtual Environment Python

Pemahaman Virtual Environment Python

University

15 Qs

Django-quiz

Django-quiz

5th Grade - University

20 Qs

MCAC0019 Quiz (Based on MODULES & PACKAGES)

MCAC0019 Quiz (Based on MODULES & PACKAGES)

University

15 Qs

Hadoop

Hadoop

University

20 Qs

Module in Python

Module in Python

Assessment

Quiz

Computers

University

Hard

Created by

Chi Quang

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of using modules in Python?
To avoid using classes
To write programs in Java
To organize reusable code in separate files
To increase the speed of the Python interpreter

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code output? import math print(math.pi
3.14159…
math.pi
Error
PI

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following imports only the sqrt function from the math module?
import math.sqrt
from math import sqrt
import sqrt from math
import sqrt

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the effect of using an alias when importing a module in Python?
It hides the module
It speeds up execution
It gives the module a shorter name
It disables built-in functions

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why is “from math import *” discouraged in large programs?
It increases performance
It increases typing
It can cause name conflicts
It hides the source of code

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you try to import a module that doesn’t exist?
The program continues silently
A warning is shown
An ImportError is raised
A file is created

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these commands installs the virtualenv tool using pip?
pip load virtualenv
pip get virtualenv
pip install virtualenv
install virtualenv pip

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?