Ojo's Python Class 2

Ojo's Python Class 2

Professional Development

15 Qs

quiz-placeholder

Similar activities

Python

Python

Professional Development

20 Qs

NumPy

NumPy

Professional Development

10 Qs

Mainstream Development Frameworks

Mainstream Development Frameworks

Professional Development

10 Qs

NumPy Interview Question

NumPy Interview Question

Professional Development

10 Qs

Python_2R

Python_2R

KG - Professional Development

20 Qs

PYTHON PANDAS

PYTHON PANDAS

Professional Development

10 Qs

Modelos en Django

Modelos en Django

Professional Development

10 Qs

Quizz_Python_1

Quizz_Python_1

Professional Development

10 Qs

Ojo's Python Class 2

Ojo's Python Class 2

Assessment

Quiz

Computers

Professional Development

Hard

Created by

Ojo Ilesanmi

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A Python module is a file with the _____ file extension that contains valid Python code.

.module

.pymodule

.pym

.py

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To use a module in another module, you must import it using an ________ statement.

import

transfer

from

to

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Suppose a function called add() is defined in a module called adder.py. Which of the following code snippets correctly show how to import and use the add() function? Select all that apply.

import adder

result = adder.add(2, 3)

import add from adder

result = add(2, 3)

from adder import add

result = add(2, 3)

from adder import add

result = adder.add(2, 3)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A package is a folder containing one or more Python modules. One of the modules in a package must be called _______.

__init__.py

__package__.py

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many except statements can a try-except block have?

zero

one

more than one

more than zero

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When will the else part of try-except-else be executed?

always

when an exception occurs

when no exception occurs

when an exception occurs in to except block

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When is the finally block executed?

when there is no exception

when there is an exception

only if some condition that has been specified is satisfied

always

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?