Table of Contents
Understanding Functions in Python: A Comprehensive Guide
🔒 Please log in to unlock this course.
MCQ Section
MCQ 1
What will be the output after the following statements? myvar = 5 def printvar() : print(myvar)…
Locked. Enroll to open this MCQ.
MCQ 2
What is printvar in the following statements? myvar = 5 def printvar() : print(myvar) printvar()
Locked. Enroll to open this MCQ.
MCQ 3
What will be the output after the following statements? myvar = 5 def printvar() : print(myvar, end…
Locked. Enroll to open this MCQ.
MCQ 4
What will be the output after the following statements? def call(var) : print(var, end ='') call(45)
Locked. Enroll to open this MCQ.
MCQ 5
What will be the output after the following statements? def call(var1, var2) : print(var1 + var2,…
Locked. Enroll to open this MCQ.
MCQ 6
What will be the output after the following statements? def call(var1, var2, var3) : print(var1 *…
Locked. Enroll to open this MCQ.
MCQ 7
What will be the output after the following statements? def call(var1=20, var2=5, var3=2) :…
Locked. Enroll to open this MCQ.
MCQ 8
What will be the output after the following statements? def call(var1=20, var2=5, var3=2) :…
Locked. Enroll to open this MCQ.
MCQ 9
What will be the output after the following statements? def call(var1=20, var2=5, var3=2) :…
Locked. Enroll to open this MCQ.
MCQ 10
What will be the output after the following statements? def call(var1=20, var2=5, var3=2) :…
Locked. Enroll to open this MCQ.
MCQ 11
What will be the output after the following statements? def call(var1=20, var2=5, var3=2) :…
Locked. Enroll to open this MCQ.
MCQ 12
What will be the output after the following statements? def call(x, y) : return x * y print(call(5,…
Locked. Enroll to open this MCQ.
MCQ 13
What will be the output after the following statements? def call(y, x) : return x / y z = call(4,…
Locked. Enroll to open this MCQ.
MCQ 14
What will be the output after the following statements? def call(x,y) : if y == 0: return return y…
Locked. Enroll to open this MCQ.
MCQ 15
What will be the output after the following statements? def call(x,y) : if x == 0: return return y…
Locked. Enroll to open this MCQ.
MCQ 16
What will be the output after the following statements? y = lambda x: x*4 print(y(6))
Locked. Enroll to open this MCQ.
MCQ 17
What will be the output after the following statements? x = 'Python' print(x.capitalize())
Locked. Enroll to open this MCQ.
MCQ 18
What will be the output after the following statements? x = 'python job interview' print(x.title())
Locked. Enroll to open this MCQ.
MCQ 19
What will be the output after the following statements? x = 'python jobs' print(x.upper())
Locked. Enroll to open this MCQ.
MCQ 20
What will be the output after the following statements? x = 'python jobs' print(x.lower())
Locked. Enroll to open this MCQ.
MCQ 21
What will be the output after the following statements? x = 'Python Jobs' print(x.swapcase())
Locked. Enroll to open this MCQ.
MCQ 22
What will be the output after the following statements? x = 'Python' print(x.join('33'))
Locked. Enroll to open this MCQ.
MCQ 23
What will be the output after the following statements? x = 'Python Test' print(x.join('33'))
Locked. Enroll to open this MCQ.
MCQ 24
What will be the output after the following statements? x = ' Python ' y = '3'…
Locked. Enroll to open this MCQ.
MCQ 25
What will be the output after the following statements? x = 'Python ' y = '3 '…
Locked. Enroll to open this MCQ.
MCQ 26
What will be the output after the following statements? x = ' Python ' y = ' 3 ' z = ' Questions '…
Locked. Enroll to open this MCQ.
MCQ 27
What will be the output after the following statements? x = 'Interview' print(x.replace('e',' '))
Locked. Enroll to open this MCQ.
MCQ 28
What will be the output after the following statements? x = 'MCQs' print(x.ljust(10,'*'))
Locked. Enroll to open this MCQ.
MCQ 29
What will be the output after the following statements? x = 'MCQs' print(x.rjust(10,'*'))
Locked. Enroll to open this MCQ.
MCQ 30
What will be the output after the following statements? x = 'MCQs' print(x.center(10,'*'))
Locked. Enroll to open this MCQ.
MCQ 31
What will be the output after the following statements? x = 'Python Pi Py Pip' print(x.count('p'))
Locked. Enroll to open this MCQ.
MCQ 32
What will be the output after the following statements? x = 'Python Pi Py' print(x.find('p'))
Locked. Enroll to open this MCQ.
MCQ 33
What will be the output after the following statements? x = 'Python Pi Py' print(x.find('P'))
Locked. Enroll to open this MCQ.
MCQ 34
What will be the output after the following statements? x = 'Pi Py Python' print(x.startswith('p'))
Locked. Enroll to open this MCQ.
MCQ 35
What will be the output after the following statements? x = 'Pi Py Python' print(x.endswith('n'))
Locked. Enroll to open this MCQ.
MCQ 36
What will be the output after the following statements? x = 'Python' print(x.isalpha())
Locked. Enroll to open this MCQ.
MCQ 37
What will be the output after the following statements? x = 'Python 3' print(x.isnumeric())
Locked. Enroll to open this MCQ.
MCQ 38
What will be the output after the following statements? x = 'Python 3 MCQ' print(x.isalnum())
Locked. Enroll to open this MCQ.
MCQ 39
What will be the output after the following statements? x = 'Python 3 MCQ' print(x.islower())
Locked. Enroll to open this MCQ.
MCQ 40
What will be the output after the following statements? x = 'Python 3 MCQ' print(x.istitle())
Locked. Enroll to open this MCQ.
MCQ 41
What will be the output after the following statements? x = 'MCQ' print(x.isupper())
Locked. Enroll to open this MCQ.
MCQ 42
What will be the output after the following statements? x = '\n' print(x.isspace())
Locked. Enroll to open this MCQ.
MCQ 43
What will be the output after the following statements? x = '2000' print(x.isdigit())
Locked. Enroll to open this MCQ.
MCQ 44
Which of the following are present in a function header?
Locked. Enroll to open this MCQ.
MCQ 45
The output of expression, k = [print(i) for i in "maverick" if i not in "aeiou"] is _______.
Locked. Enroll to open this MCQ.
MCQ 46
The output of the expression [ chr(i) for i in [65, 66, 67] ] is _______.
Locked. Enroll to open this MCQ.
MCQ 47
Which of the following types of arguments can be passed to a function?
Locked. Enroll to open this MCQ.
MCQ 48
The output of the expression {0 if i%2 ==0 else 1 for i in range(8)} is _______.
Locked. Enroll to open this MCQ.
MCQ 49
The elements of an iterator can be accessed multiple times.
Locked. Enroll to open this MCQ.
MCQ 50
What is the default return value of a Python function?
Locked. Enroll to open this MCQ.
MCQ 51
The output of the expression itertools.takewhile(lambda x: x
Locked. Enroll to open this MCQ.
MCQ 52
What is the return type of function 'id'?
Locked. Enroll to open this MCQ.
MCQ 53
What value does 'k' hold after executing the expression, k = [print(i) for i in "maverick" if i not…
Locked. Enroll to open this MCQ.
MCQ 54
The output of the expression sorted ({ ord(i) for i in 'apple' }) is _______.
Locked. Enroll to open this MCQ.
MCQ 55
What will be the output after the following statements? x = '2.7' print(x.isdecimal())
Locked. Enroll to open this MCQ.
MCQ 56
What will be the output after the following statements? def x(y,z): pass x(1,4)
Locked. Enroll to open this MCQ.
MCQ 57
What will be the output after the following statements? b = 1 for a in range(1, 10, 3): b += a + 1…
Locked. Enroll to open this MCQ.
MCQ 58
What will be the output after the following statements? b = 1 for a in range(1, 10): b += a - 1…
Locked. Enroll to open this MCQ.
MCQ 59
What will be the output after the following statements? b = 3 for a in range(10, 1): b -= a + 1…
Locked. Enroll to open this MCQ.
MCQ 60
What will be the output after the following statements? b = 1 for a in range(1, 5): b *= a + 1…
Locked. Enroll to open this MCQ.
MCQ 61
What will be the output after the following statements? a = 4**3 b = pow(4,3) print(a, b)
Locked. Enroll to open this MCQ.
MCQ 62
What will be the output after the following statements? a = round(5.3) b = round(5.6) c =…
Locked. Enroll to open this MCQ.
MCQ 63
What will be the output after the following statements? a = round(4.49999) print(a)
Locked. Enroll to open this MCQ.
MCQ 64
What will be the output after the following statements? print([(x, x*2) for x in range(4)])
Locked. Enroll to open this MCQ.
MCQ 65
What will be the output after the following statements? x = [int(i**3/3) for i in range(0,5,2)]…
Locked. Enroll to open this MCQ.
MCQ 66
What will be the output after the following statements? x = [int(i/2-5) for i in range(3,8,2)]…
Locked. Enroll to open this MCQ.
MCQ 67
What will be the output after the following statements? def abc(world): print('hello %s' % world)…
Locked. Enroll to open this MCQ.
MCQ 68
What will be the output after the following statements? def abc(x, y): print('hello %s %s' % (y,…
Locked. Enroll to open this MCQ.
MCQ 69
What will be the output after the following statements? b = 'Python' a = 'world' def pypi(x, y):…
Locked. Enroll to open this MCQ.
MCQ 70
What will be the output after the following statements? a = 12 b = 45 c = 10 def pypi(x, y, z):…
Locked. Enroll to open this MCQ.
MCQ 71
What will be the output after the following statements? def pypi(): b = 25 c = 20 return(a * b - c)…
Locked. Enroll to open this MCQ.
MCQ 72
What will be the output after the following statements? def xyz(): x = 40 abc() print(x) def abc():…
Locked. Enroll to open this MCQ.
MCQ 73
What will be the output after the following statements? def xyz(): x = 40 def abc(): xyz() a = 32 x…
Locked. Enroll to open this MCQ.
MCQ 74
What will be the output after the following statements? def abc(): print(x) x = 10 abc()
Locked. Enroll to open this MCQ.
MCQ 75
What will be the output after the following statements? def abc(): x = 12 print(x) x = 10 abc()
Locked. Enroll to open this MCQ.
MCQ 76
What will be the output after the following statements? def abc(): x = 10 print(x) abc() x = 12
Locked. Enroll to open this MCQ.
MCQ 77
What will be the output after the following statements? def abc(): global x x = 23 x = 10 abc()…
Locked. Enroll to open this MCQ.
MCQ 78
What will be the output after the following statements? def abc(x): return 20 / x print(abc(4))
Locked. Enroll to open this MCQ.
MCQ 79
What will be the output after the following statements? def abc(z): z.append(44) x = [7, 8, 9]…
Locked. Enroll to open this MCQ.
Get Python Programming Language updates by email
Short, practical lessons and course updates from Rumman Ansari. No spam.