Python Functions and Modules Quiz

Python Functions and Modules Quiz

12th Grade

14 Qs

quiz-placeholder

Similar activities

HVAC Motors

HVAC Motors

8th Grade - University

15 Qs

Magnets and Bluetooth Speaker

Magnets and Bluetooth Speaker

6th Grade - University

15 Qs

SO ASTRONOMY GAME C

SO ASTRONOMY GAME C

10th - 12th Grade

16 Qs

Algebra 1 Unit 3 Vocabulary

Algebra 1 Unit 3 Vocabulary

9th - 12th Grade

9 Qs

Scientific Investigation

Scientific Investigation

9th - 12th Grade

18 Qs

Variable Identification

Variable Identification

9th - 12th Grade

15 Qs

PLC

PLC

12th Grade - University

15 Qs

Python Functions and Modules Quiz

Python Functions and Modules Quiz

Assessment

Quiz

Science

12th Grade

Hard

Created by

S.KINGSLEY CSE

FREE Resource

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a function in Python?

A way to handle exceptions

A method to create loops

A block of code that performs a specific task

A type of variable

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a function in Python?

define greet():

create greet():

def greet():

function greet():

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of greet('John') if greet is defined as def greet(name): print('Hello', name)?

Hello World

John

Hello John

Hello

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the asterisk (*) in function definitions?

To denote a global variable

To indicate a local variable

To allow arbitrary arguments

To create a loop

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of variable is created inside a function?

Nonlocal variable

Local variable

Static variable

Global variable

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is recursion in programming?

A function calling itself

A method to repeat a function

A type of loop

A way to handle errors

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the math module provide?

Network communication tools

File handling methods

Mathematical functions and constants

String manipulation functions

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?