NEW
Font size
WorksheetsWoking with Function
Total questions: 10
Worksheet time: 8mins
Functions created by user is called _________ function
I. Inbuilt
II. Library
III. User defined
IV. logical
Division of large programs into smaller programs. These smaller programs are called________.
a) Functions
b) Operators
c) logical programs
d) specific programs
We have to import a specific module for using built-in functions?
True
False
A function can be called _____ times in a program
3
7
4
Any no. of times
Write the output of the following: if user entered 7
a=input("Enter age")
print(type(a))
str
int
float
Write the output of the following:
print(max(2,5,4,8,29,24))
Error as there should be math.max( )
29
2
2 5 4 8 29 24
Write the output of the following:
print(list(i*2 for i in range(4)))
print(list(range(4)))
[0, 2, 4, 6]
[3]
[0, 2, 4, 6]
[0, 1, 2, 3]
[0, 1, 2, 3]
[0, 1, 2, 3]
none
Advantage of using function is/are
a) Reusability of Code
b) Divide a complex problem into simpler ones
c) Reduces chances of error
d) All of the above
A function definition begins with ___________
a) def
b) define
c) create
d) New
Function header always ends with a __________
a) Comma
b) Colon
c) Semicolon
d) period
