Font size
WorksheetsPython Function
Total questions: 11
Worksheet time: 6mins
Name the keyword used to define a function.
define
def
function
fu
def square(x) (a)
print(x*x)
Which one is not true about function?
It breaks the large program into small modules.
It avoids repetition.
It makes code reusable.
It makes the program unorganized.
Which statement is used to display the docstring?
print(welcome.__doc__)
print(__doc__)
print(welcome._doc_)
print(docstring)
What is the value of Y?
Error
None
Alsan
Hello, Alsan Good Morning!
Which one is incorrect calling function statement?
add(4, c = 10, b = 5)
add(3, 4, c = 45)
add (b = 12, c = 10, 1)
add (5, 6, 7)
What will be the output?
Value inside function: 10
Value outside function: 20
Value inside function: 10
Value outside function: 10
Value inside function: 20
Value outside function: 10
Value inside function: 20
Value outside function: 20
What is the output?
Value inside function: 10
Value outside function: 20
Value inside function: 10
Value outside function: 10
Value inside function: 20
Value outside function: 20
Value inside function: 20
Value outside function: 10
def add(x,y):
return x+y
a = 5
b = 10
add(a,b)
Name the actual parameters.
a,b
x,y
a,x
b,y
def add(x,y):
return x+y
a = 5
b = 10
add(a,b)
Name the formal parameters.
a,b
x,y
a,x
b,y
What will print ?
cats eat mice
mice get away
unknown
error message
