Ojo's Python Class 2

Ojo's Python Class 2

Professional Development

15 Qs

quiz-placeholder

Similar activities

PSC Quiz1

PSC Quiz1

University - Professional Development

20 Qs

Day 1 - Basics of Java

Day 1 - Basics of Java

Professional Development

14 Qs

C programming_Shivank

C programming_Shivank

Professional Development

20 Qs

M365 Security Pillar 1 (Identity & Access Management)

M365 Security Pillar 1 (Identity & Access Management)

Professional Development

10 Qs

Javascript - Revisão

Javascript - Revisão

University - Professional Development

19 Qs

EAE_DataScience_S2

EAE_DataScience_S2

Professional Development

10 Qs

aXQtMjktMTEtMjAyMg==

aXQtMjktMTEtMjAyMg==

Professional Development

10 Qs

Java Quiz#3(Local Variables)

Java Quiz#3(Local Variables)

Professional Development

10 Qs

Ojo's Python Class 2

Ojo's Python Class 2

Assessment

Quiz

Computers

Professional Development

Practice Problem

Hard

Created by

Ojo Ilesanmi

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?