Functions in Python

Functions in Python

10th Grade

10 Qs

quiz-placeholder

Similar activities

Marketing and Sales 1.4

Marketing and Sales 1.4

9th - 12th Grade

9 Qs

Compound Interest

Compound Interest

10th - 11th Grade

10 Qs

Adopt me roblox quiz by stupidelephant911

Adopt me roblox quiz by stupidelephant911

KG - Professional Development

11 Qs

Romanian Folklore

Romanian Folklore

8th - 10th Grade

11 Qs

Engaging Secondary Science

Engaging Secondary Science

6th - 12th Grade

14 Qs

ABOUT TÜRKİYE

ABOUT TÜRKİYE

6th - 12th Grade

13 Qs

Guess the anime

Guess the anime

KG - Professional Development

6 Qs

Ant science

Ant science

5th Grade - University

11 Qs

Functions in Python

Functions in Python

Assessment

Quiz

Other

10th Grade

Medium

Created by

Deepak M

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What is the output of the following function call def function(name,age=22):

print(name,age)

function('charlie',25)

charlie

25

charlie 25

name 25

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Select which true for Python function

A function is a code block that only executes when called and always returns a value.

A function only executes when it is called and we can reuse it in a program

Python doesn’t support nested function

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following are the two main parts of every function in Python?

The function heading and the function body

The function signature and the function corpus

The function signature and the function body

The function head and the function tail

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following function:

def square(num):

num_sqaured=num**2

return num_squared

def square(num):

num_squared=num**2

return num_squared

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following keywords are used to create a loop in Python?

if

for

foreach

loop

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following loop:

for num in range(1,5):

print(num)

1

2

3

4

5

0

1

2

3

4

1

2

3

4

2

3

4

5

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

x = 0

while x < 10:

x = x + 1

What’s the value of x after the above code snippet executes?

0

9

10

11

Create a free account and access millions of resources

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?