Section 4A: Decompose the code using functions

Section 4A: Decompose the code using functions

12th Grade

14 Qs

quiz-placeholder

Similar activities

Python function output based KVRDSO lucknow

Python function output based KVRDSO lucknow

11th - 12th Grade

11 Qs

python 2

python 2

11th - 12th Grade

10 Qs

Python Built-in Functions

Python Built-in Functions

11th - 12th Grade

15 Qs

Problem solving technique-Function

Problem solving technique-Function

12th Grade - University

15 Qs

PCEP Section 4D: Basics of Python Exception Handling

PCEP Section 4D: Basics of Python Exception Handling

12th Grade

15 Qs

Python функції

Python функції

12th Grade

13 Qs

Pandas

Pandas

12th Grade

10 Qs

Functions With Return Values U1M2 Python

Functions With Return Values U1M2 Python

9th - 12th Grade

12 Qs

Section 4A: Decompose the code using functions

Section 4A: Decompose the code using functions

Assessment

Quiz

Computers

12th Grade

Medium

Created by

Misti McDaniel

Used 2+ times

FREE Resource

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used in Python to define a user-defined function?

function

def

func

define

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default return value of a function in Python if there is no return statement?

0

None

False

""

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to invoke a function named `greet`?

call greet

greet()

greet

invoke greet

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the `return` keyword do in a Python function?

Exits the program

Exits the function and optionally passes back a value

Prints a value to the screen

Continues to the next iteration

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes a generator in Python?

A function that returns a list

A function that uses `yield` to produce a sequence of values

A function that only prints values

A function that returns None

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Given the following code, what will be printed? def foo(): pass print(foo())

0

None

foo

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about recursion is TRUE?

A recursive function must always have a base case.

Recursive functions cannot call themselves.

Recursion is only possible with integers.

Recursion is not allowed in Python.

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?