Python Functions

Python Functions

12th Grade

15 Qs

quiz-placeholder

Similar activities

Function/Not a Function

Function/Not a Function

10th - 12th Grade

11 Qs

вввв

вввв

1st - 12th Grade

14 Qs

Algebra Regents Review

Algebra Regents Review

10th - 12th Grade

10 Qs

Angle Bisectors

Angle Bisectors

9th - 12th Grade

10 Qs

CONGRUENCE OF TRIANGLES

CONGRUENCE OF TRIANGLES

KG - University

10 Qs

Chi Squared Goodness of Fit

Chi Squared Goodness of Fit

11th Grade - University

15 Qs

Increasing & Decreasing Functions

Increasing & Decreasing Functions

12th Grade

10 Qs

Python

Python

10th - 12th Grade

20 Qs

Python Functions

Python Functions

Assessment

Quiz

Mathematics

12th Grade

Medium

Created by

Jérome Simon

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

function my_function():

def my_function():

create my_function():

function: my_function()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you call (use) a function named greet in Python?

call greet()

greet()

function greet()

greet

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will the following function return?

The sum of x and y

x

y

Nothing

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to define a function with two parameters in Python?

def multiply(x, y):

def multiply: x, y

def multiply(x y):

def multiply - x, y:

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the following function do?

Prints the message once

Prints the message twice

Causes a syntax error

Nothing

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code?

5

10

x*2

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true about the scope of variables in functions?

Variables defined inside a function are accessible from anywhere in the program.

Variables defined outside a function are not accessible inside the function.

Variables defined inside a function are only accessible within the function.

Variables cannot be defined inside 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?