wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Woking with Function

Total questions: 10

Worksheet time: 8mins

Name
Class
Date
1.

Functions created by user is called _________ function

a)

I. Inbuilt

b)

II. Library

c)

III. User defined

d)

IV. logical

2.

Division of large programs into smaller programs. These smaller programs are called________.

a)

a) Functions

b)

b) Operators

c)

c) logical programs

d)

d) specific programs

3.

We have to import a specific module for using built-in functions?

a)

True

b)

False

4.

A function can be called _____ times in a program

a)

3

b)

7

c)

4

d)

Any no. of times

5.

Write the output of the following: if user entered 7

a=input("Enter age")

print(type(a))

a)

str

b)

int

c)

float

6.

Write the output of the following:

print(max(2,5,4,8,29,24))

a)

Error as there should be math.max( )

b)

29

c)

2

d)

2 5 4 8 29 24

7.

Write the output of the following:

print(list(i*2 for i in range(4)))

print(list(range(4)))

a)

[0, 2, 4, 6]

[3]

b)

[0, 2, 4, 6]

[0, 1, 2, 3]

c)

[0, 1, 2, 3]

[0, 1, 2, 3]

d)

none

8.

Advantage of using function is/are

a)

a) Reusability of Code

b)

b) Divide a complex problem into simpler ones

c)

c) Reduces chances of error

d)

d) All of the above

9.

A function definition begins with ___________

a)

a) def

b)

b) define

c)

c) create

d)

d) New

10.

Function header always ends with a __________

a)

a) Comma

b)

b) Colon

c)

c) Semicolon

d)

d) period