wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Functions in Python

Total questions: 10

Worksheet time: 10mins

Name
Class
Date
1.

Which of the following is not a built-in function?

a)

type( )

b)

len( )

c)

def findSum():

d)

eval( )

2.

What is the output of the following function call?

a)

var1+var2

b)

50

c)

10,40

d)

no output

3.

Which of the following is used to return a result from a function?

a)

catch

b)

continue

c)

break

d)

return

4.


What will be the output of the following Python code?

a)

10

b)

num

c)

x

d)

no output

5.

Which of the following is correct regarding an Argument?

a)

A variable which we use in the function definition

b)

A value we pass when we call the function

c)

The order in which statements are executed 

d)

A keyword used to return a result from a function

6.

What will be the output of the following Python code?

a)

sara 19

b)

name age

c)

NameError

d)

no output

7.

The function randint( ) returns random integers between low and high numbers?

a)

True

b)

False

8.

What is the output of the following Python code?print(round(51.6))

a)

51.6

b)

52

c)

51

d)

round(51.6)

9.

What is the output of the following Python code?

num = 3

print( float(num) )

a)

flaot(num)

b)

3

c)

3.0

d)

TypeError

10.

What is the output of the following function call?

a)

5

b)

25

c)

30

d)

no output