0 of 20 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
0 of 20 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
1. Which of the following is the use of function in python?
2. What is the default return value for a function that does not return any value explicitly?
3. Which of the following items are present in the function header?
4. Which of the following enclose the input parameters or arguments of a function?
5. Which of the following keywords marks the beginning of the function block?
6. What is the name given to that area of memory, where the system stores the parameters and local variables of a function call?
________
7. Which of the following function definition does not return any value?
8. What is the output of the following code snippet?
def func(message, num = 1):
print(message * num)
func(‘Welcome’)
func(‘Viewers’, 3)
What will be the output after the following statements?
b = ‘Python’
a = ‘world’
def pypi(x, y):
print(‘hello %s %s’ % (y, x))
pypi(a, b)
10. What will be the output after the following statements?
a = 12
b = 45
c = 10
def pypi(x, y, z):
return(z * y – x)
print(pypi(b, c, a))
11. What will be the output after the following statements?
def pypi():
b = 25
c = 20
return(a * b – c)
a = 12
print(pypi())
12. What will be the output after the following statements?
def abc(world):
print(‘hello %s’ % world)
abc(‘Python’)
13. What will be the output after the following statements?
def abc(x, y):
print(‘hello %s %s’ % (y, x))
abc(‘Python’, ‘world’)
14.What will be the output after the following statements?def xyz():
x = 40
def abc():
xyz()
a = 32
x = 10
print(x)
abc()
15. What will be the output after the following statements?
def abc():
print(x)
x = 10
abc()
16. What will be the output after the following statements?
def abc():
x = 12
print(x)
x = 10
abc()
17. What will be the output after the following statements?
def abc():
x = 10
print(x)
abc()
x = 12
18. What will be the output after the following statements?
def abc(x):
return 20 / x
print(abc(4))
19. What will be the output after the following statements?
def abc(x):
try:
print(20 / x)
except:
print(‘Not a valid argument’, end=’ ‘)
finally:
print(0, end=’ ‘)
print(abc(0))
20. Match the followings
1. Functions defined by the users themselves |
2. Functions that are built with in python |
3. Functions that are anonymous un-named functions |