Ojo's Python Class 2

Ojo's Python Class 2

Professional Development

15 Qs

quiz-placeholder

Similar activities

FORMATIVE ASSESSMENT 2 OOPS

FORMATIVE ASSESSMENT 2 OOPS

Professional Development

15 Qs

ES_Midterm Quiz

ES_Midterm Quiz

Professional Development

20 Qs

Chapter1

Chapter1

Professional Development

20 Qs

Python

Python

Professional Development

20 Qs

Quiz 5.1

Quiz 5.1

Professional Development

20 Qs

Java Strings

Java Strings

1st Grade - Professional Development

10 Qs

Проверяю знания и изучаю PyGame

Проверяю знания и изучаю PyGame

Professional Development

12 Qs

Datatypes and Flowcontrol

Datatypes and Flowcontrol

Professional Development

15 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?