PCED-Python Functions and Exceptions Quiz

PCED-Python Functions and Exceptions Quiz

Professional Development

20 Qs

quiz-placeholder

Similar activities

Exceptions and Classes

Exceptions and Classes

Professional Development

21 Qs

15 days of code quiz 2

15 days of code quiz 2

11th Grade - Professional Development

22 Qs

Datatypes and Flowcontrol

Datatypes and Flowcontrol

Professional Development

15 Qs

FORMATIVE ASSESSMENT 2 OOPS

FORMATIVE ASSESSMENT 2 OOPS

Professional Development

15 Qs

Functions on C

Functions on C

Professional Development

15 Qs

Pioneer Coding - Mid Year Quiz (Python and Pokemon)

Pioneer Coding - Mid Year Quiz (Python and Pokemon)

Professional Development

15 Qs

ANOVISION ROUND 2

ANOVISION ROUND 2

Professional Development

20 Qs

Introduction to Machine Learning

Introduction to Machine Learning

University - Professional Development

20 Qs

PCED-Python Functions and Exceptions Quiz

PCED-Python Functions and Exceptions Quiz

Assessment

Quiz

Computers

Professional Development

Medium

Created by

Pooja Dogra

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary benefit of decomposing code into functions?

Faster execution

Improved readability and reusability

Reduced memory usage

Fewer lines of code

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to define a function in Python?

def functionName:

function functionName()

def functionName():

def functionName[]:

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following can functions help achieve?

Avoid code duplication

Perform tasks repeatedly with different inputs

Break down a large problem into smaller tasks

All of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? def greet(): return "Hello" print(greet())

Hello

None

Error

greet

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT true about Python functions?

Functions can return multiple values.

Functions cannot modify global variables.

Functions can have default parameters.

Functions can be nested inside other functions.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the term for passing values into a function?

Calling

Arguments

Parameters

Invoking

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does a return statement do in a function?

Ends the function execution and optionally returns a value

Executes the function repeatedly

Pauses the function execution temporarily

Takes input from the user

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?