Python Modules and Packages

Python Modules and Packages

University

10 Qs

quiz-placeholder

Similar activities

Software Testing - Unit 5 Two marks test

Software Testing - Unit 5 Two marks test

University

10 Qs

Advanced Java Lab_4CSN

Advanced Java Lab_4CSN

University

10 Qs

CHP1: INTRODUCTION TO CAO

CHP1: INTRODUCTION TO CAO

University

10 Qs

VB

VB

University

6 Qs

SE Quiz 2 (H)

SE Quiz 2 (H)

University

10 Qs

Flutter Basics

Flutter Basics

KG - University

15 Qs

Week 2 Quiz 3 - SHEstem IoT Cohort

Week 2 Quiz 3 - SHEstem IoT Cohort

University

10 Qs

C++ Functions

C++ Functions

University

10 Qs

Python Modules and Packages

Python Modules and Packages

Assessment

Quiz

Computers

University

Hard

Created by

Lavakumar Gopu

Used 94+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

To put definitions in a file and use them in another scripts, we use_____

packages

functions

modules

project

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is not an advantage of using modules?

Provides a means of reuse of program code

Provides a means of dividing up tasks

Provides a means of reducing the size of the program

Provides a means of testing individual parts of the program

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What will be the output of the following Python code?

from math import factorial

print(math.factorial(5))

120

Nothing is printed

Error, method factorial doesn’t exist in math module

Error, the statement should be: print(factorial(5))

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is false about “from-import” form of import?

The syntax is: from modulename import identifier

This form of import prevents name clash

The namespace of imported module becomes part of importing module

None of the Above

5.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

A module consists of

functions

variables

packages

classes

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is true regarding a package

it is a python file

it is an executable file

it is a directory

ALL

7.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

Which of the following are contained by packages

modules

files

__init__.py

packages

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?