0% found this document useful (0 votes)
6 views143 pages

Chapter 6 Functions

The document contains a series of multiple-choice questions (MCQs) related to functions in Python, covering topics such as function definitions, types, advantages, and outputs of specific code snippets. Each question provides four options, with the correct answers implied but not explicitly stated. The document is structured in a quiz format, aimed at assessing knowledge of Python functions.

Uploaded by

nice29705
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views143 pages

Chapter 6 Functions

The document contains a series of multiple-choice questions (MCQs) related to functions in Python, covering topics such as function definitions, types, advantages, and outputs of specific code snippets. Each question provides four options, with the correct answers implied but not explicitly stated. The document is structured in a quiz format, aimed at assessing knowledge of Python functions.

Uploaded by

nice29705
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 143

MCQ Question & Answer

Chapter [6]

Function
In Python
LESSION 6 OF 9

Contact Us
JOIN US ON for Free Course +91-9027902171
Q1. Which of the following is true about functions in Python?

पायथन में फ़ंक्शन के बारे में ननम्नलिखित में से कौन सा सत्य है?

(A) Functions are reusable pieces of programs.

(B) Functions don’t provide better modularity.

(C) You can’t create your own functions.

(D) All of the mentioned.

Contact Us
JOIN US ON for Free Course +91-9027902171
Q2. Which keyword is used for function?

फ़ंक्शन के लिए कौन सा कीवर्ड इस्तेमाि नकया जाता है?

(A) Fun

(B) Define

(C) def

(D) Function

Contact Us
JOIN US ON for Free Course +91-9027902171
Q3. In a program, a function can be called _____ times.

नकसी प्रोग्राम में, नकसी फ़ंक्शन को _____ बार कॉि नकया जा सकता है।

(A) 3

(B) 2

(C) 5

(D) Multiple times

Contact Us
JOIN US ON for Free Course +91-9027902171
Q4. Which are the advantages of functions in Python?

पायथन में फ़ंक्शन के क्या िाभ हैं?

(A) Reducing duplication of code

(B) Decomposing complex problems into simpler pieces

(C) Improving clarity of the code

(D) All of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q5. What are the two main types of functions?

फ़ंक्शन के दो मुख्य प्रकार क्या हैं?

(A) Custom function

(B) Built-in function & User-defined function

(C) User function

(D) System function

Contact Us
JOIN US ON for Free Course +91-9027902171
Q6. Where is a function defined?

फ़ंक्शन कहााँ पररभाषित नकया जा सकता है?

(A) Module

(B) Class

(C) Another function

(D) All of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q7. What will be the output of the following Python code?

ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?

(A) 9 def cube(x):


return x**3
(B) 3
x = cube(3)
(C) 27 print(x)
(D) 30

Contact Us
JOIN US ON for Free Course +91-9027902171
Q8. Functions which are already defined in Python are called?

पायथन में पहिे से पररभाषित फ़ंक्शन को क्या कहते हैं?

(A) User-defined functions

(B) Library functions

(C) Built-in functions

(D) Both (B) and (C)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q9. What will be the output of the following Python code?

ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?

(A) 48 y=6
(B) 14 z = lambda x: x * y
print(z(8))
(C) 64

(D) None of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q10. What is a variable defined outside a function referred to as?

नकसी फ़ंक्शन के बाहर पररभाषित वैररएबि को क्या कहा जाता है?

(A) A static variable

(B) A global variable

(C) A local variable

(D) An automatic variable

Contact Us
JOIN US ON for Free Course +91-9027902171
Q11. Write the output of the following:

ननम्नलिखित का आउटपुट क्या है: def cal(m, n):


if m == n:
(A) 16
return m * 3
(B) 18 else:
return m * 2
(C) 27

(D) 24 s = cal(9, 8)
print(s)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q12. What is a variable defined inside a function referred to as?

नकसी फ़ंक्शन के अ़ं दर पररभाषित वैररएबि को क्या कहा जाता है?

(A) A global variable

(B) A volatile variable

(C) A local variable

(D) An automatic variable

Contact Us
JOIN US ON for Free Course +91-9027902171
Q13. What is the output of the following:

ननम्नलिखित का आउटपुट क्या है: i=0


def change(i):
(A) 1 i=i+1
(B) Nothing is displayed return i
print(change(1))
(C) 0
print(i)
(D) An exception is thrown

Contact Us
JOIN US ON for Free Course +91-9027902171
Q14. What is the output of the following:

ननम्नलिखित का आउटपुट क्या है:

(A) 0 def fn(n1, n2=7):


n1 = n1 % n2
(B) 1
print(n1)
(C) 2 fn(3 % 2, 9 % 2)

(D) 3

Contact Us
JOIN US ON for Free Course +91-9027902171
Q15. Functions which do not return any value are called:

ऐसे फ़ंक्शन जो कोई मान नहीं िौटाते हैं उन्हें क्या कहा जाता है?

(A) default function

(B) zero function

(C) void function

(D) null function

Contact Us
JOIN US ON for Free Course +91-9027902171
Q16. What will be the output of the following Python code?

ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?

def change(i=2, j=2):


(A) Error
i=i+j
(B) 1 2 j=j+1
(C) 3 3 print(i, j)

(D) 3 2 change(j=1, i=2)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q17. The return statement in function is used to:

फ़ंक्शन में ररटनड स्टेटमेंट का उपयोग नकसके लिए नकया जाता है?

(A) return value

(B) returns the control to the calling function

(C) Both a and b

(D) None of the above

Contact Us
JOIN US ON for Free Course +91-9027902171
Q18. The part of the program where a variable is accessible is known as the
____ of that variable.

प्रोग्राम का वह भाग जहााँ कोई वैररएबि पहाँच योग्य होता है, उस वैररएबि का ____ कहिाता है।

(A) scope

(B) module

(C) part

(D) none of the above

Contact Us
JOIN US ON for Free Course +91-9027902171
Q19. What will be the output of the following Python code?

ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?


def display(b, n):
(A) zzz while n > 0:
(B) zz print(b, end="")
n=n-1
(C) An exception is executed
display('z', 3)
(D) Infinite loop

Contact Us
JOIN US ON for Free Course +91-9027902171
Q20. How many keyword arguments can be passed to a function in a single
function call? एक फ़ंक्शन कॉि में फ़ंक्शन को नकतने कीवर्ड तकड पास नकए जा सकते हैं?

(A) zero

(B) one

(C) zero or more

(D) one or more

Contact Us
JOIN US ON for Free Course +91-9027902171
Q21. Write the output of the following:

def c(x, y):


(A) 26
if x % y:
(B) 15 return x + 5
else:
(C) 30
return y + 10
(D) 25 print(c(20, 5))

Contact Us
JOIN US ON for Free Course +91-9027902171
Q22. Write the output of the following: ननम्नलिखित का आउटपुट लििें:

(A) [0] [1] [2] def foo(i, x=[ ]):


x.append(i)
(B) [0] [0, 1] [0, 1, 2]
return x
(C) [1] [2] [3] for i in range(3):
print(foo(i))
(D) [1] [1, 2] [1, 2, 3]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q23. Which module in the python standard library parses options received
from the command line?

पायथन स्टैंर्र्ड िाइब्रेरी में कौन सा मॉड्यूि कमा़ंर् िाइन से प्राप्त षवक्पों को पासड करता है?

(A) getopt

(B) os

(C) getarg

(D) main

Contact Us
JOIN US ON for Free Course +91-9027902171
Q24. What is the type of `sys.argv`?

`Sys.argv` का प्रकार क्या है?

(A) set

(B) list

(C) tuple

(D) string

Contact Us
JOIN US ON for Free Course +91-9027902171
Q25. What is the value stored in `sys.argv[0]`?

`Sys.argv[0]` में स़ंग्रहहत मान क्या है?

(A) null

(B) you cannot access it

(C) the program’s name

(D) the first argument

Contact Us
JOIN US ON for Free Course +91-9027902171
Q26. What will be the output of the following Python code?

(A) Error
def f1():
(B) 12 x = 15

(C) 15 print(x)
x = 12
(D) 1512
f1()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q27. What will be the output of the following Python code?

(A) 13 def san(x):


print(x + 1)
(B) 10
x = -2
(C) 2 x=4
san(12)
(D) 5

Contact Us
JOIN US ON for Free Course +91-9027902171
Q28. What will be the output of the following Python code?

(A) Error x = 12
def f1(a, b=x):
(B) 12 4
print(a, b)
(C) 4 12 x = 15

(D) 4 15 f1(4)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q29. Which of these is not true about recursion?

इनमें से कौन सा ररकर्डन के बारे में सही नहीं है?

(A) Making the code look clean

(B) A complex task can be broken into sub-problems

(C) Recursive calls take up less memory

(D) Sequence generation is easier than a nested iteration

Contact Us
JOIN US ON for Free Course +91-9027902171
Q30. What will be the output of the following code?

(A) 3 def func(a, b, c=5):


return a + b + c
(B) 8
print(func(1, 2))
(C) 7

(D) 6

Contact Us
JOIN US ON for Free Course +91-9027902171
Q31. What will be the output of the following code?

(A) 12 def func(a, b=1, c=2):


return a + b + c
(B) 13
print(func(5, 6))
(C) 11

(D) 14

Contact Us
JOIN US ON for Free Course +91-9027902171
Q32. What is the output of the following code snippet?

print([i.lower() for i in "HELLO"])

(A) hello

(B) ['h', 'e', 'l', 'l', 'o']

(C) hel

(D) HELLO

Contact Us
JOIN US ON for Free Course +91-9027902171
Q33. What is the output of the following Python code?

Y = [2,5J,6]

Y.sort()

(A) [2, 6, 5J]

(B) [5J, 2, 6]

(C) [6, 5J, 2]

(D) Error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q34. What is the output of the following code?

(A) 6 4 def s(n1):


print(n1)
(B) 4 6
n1 = n1 + 2
(C) 4 4 n2=4
s(n2)
(D) 6 6
print(n2)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q35. What is the output of the following Python code?

(A) zzz def display(b, n):


(B) zz while n>0:
print(b, end='')
(C) Infinite Loop
n = n-1
(D) An exception is thrown display('z', 3)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q36. What is the interval of the value generated by the function

(A) (0,1) import random


(B) (0,1] random.random( )

(C) [0,1]

(D) [0,1)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q37. What is the output of the following Python code?

def power(x, y=2):


(A) 212 32
r=1
(B) 9 27 for i in range(y):

(C) 567 98 r=r*x


return r
(D) None of these
print(power(3))
print(power(3, 3))

Contact Us
JOIN US ON for Free Course +91-9027902171
Q38. Which of the following are valid string manipulation functions in
Python?

(A) count()

(B) upper()

(C) strip()

(D) All of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q39. Which of the following will run without errors?

(A) round(45.8)

(B) round(6352.898, 2,5)

(C) round()

(D) round(7463.123, 2, 1)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q40. What will be the output after the following statements?

(A) m m = 18
(B) nop def nop():
print(m)
(C) 18
nop()
(D) Mnop

Contact Us
JOIN US ON for Free Course +91-9027902171
Q41. What will be the output of the following Python code snippet?

ननम्नलिखित पायथन कोर् खिपेट का आउटपुट क्या होगा?

print('abef'.partition('cd'))

(A.) ('abef')

(B.) ('abef', 'cd', '')

(C.) ('abef', '', '')

(D.) error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q42. What will be the output of the following Python code snippet?

ननम्नलिखित पायथन कोर् खिपेट का आउटपुट क्या होगा?

print('abcdef12'.replace('cd', '12'))

(A.) ab12ef12

(B.) abcdef12

(C.) ab12efcd

(D.) none of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q43. What will be the output of the following Python code snippet?

ननम्नलिखित पायथन कोर् खिपेट का आउटपुट क्या होगा?

print('abcefd'.replace('cd', '12'))

(A.) ab1ef2

(B.) abcefd

(C.) ab1efd

(D.) ab12ed2

Contact Us
JOIN US ON for Free Course +91-9027902171
Q44. What will be the output of the following Python code snippet?

print('xyxyxyxyxyxyxyxxy'.replace('xy', '12', 100))

(A.) xyxyxyxyxyxyxyxxy

(B.) 12y12y1212x12

(C.) none of the mentioned

(D.) error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q45. What will be the output of the following Python code snippet?

ननम्नलिखित पायथन कोर् खिपेट का आउटपुट क्या होगा?

print('abcdefcdghcd'.split('cd'))

(A.) ('ab', 'ef', 'gh')

(B.) ('ab', 'ef', 'gh', '')

(C.) ['ab', 'ef', 'gh']

(D.) ['ab', 'ef', 'gh', '']

Contact Us
JOIN US ON for Free Course +91-9027902171
Q46. What will be the output of the following Python code snippet?

print('abcdefcdghcd'.split('cd', 0))

(A.) ['abcdefcdghcd']

(B.) 'abcdefcdghcd'

(C.) error

(D.) none of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q47. What will be the output of the following Python code snippet?

print('abcdefcdghcd'.split('cd', -1))

(A.) ['ab', 'ef', 'gh']

(B.) ['ab', 'ef', 'gh', '']

(C.) ('ab', 'ef', 'gh')

(D.) ('ab', 'ef', 'gh', '')

Contact Us
JOIN US ON for Free Course +91-9027902171
Q48. What will be the output of the following Python code snippet?

print('abcdefcdghcd'.split('cd', 2))

(A.) ['ab', 'ef', 'ghcd']

(B.) ['ab', 'efcdghcd']

(C.) ['abcdef', 'ghcd']

(D.) none of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q49. What will be the output of the following Python code snippet?

print('ab\ncd\nef'.splitlines())

(A.) ['ab', 'cd', 'ef']

(B.) ['ab ', 'cd ', 'ef ']

(C.) ['ab ', 'cd ', 'ef']

(D.) ['ab', 'cd', 'ef ']

Contact Us
JOIN US ON for Free Course +91-9027902171
Q50. What will be the output of the following Python function?

any([2>8, 4>2, 1>2])

(A.) True

(B.) False

(C.) Error

(D.) 4>2

Contact Us
JOIN US ON for Free Course +91-9027902171
Q51. ननम्नलिखित में से कौन सा कोर् का एक यूननट है जजसे अक्सर एक बडे कोर् स्ट्रक्चर के
भीतर पररभाषित नकया जाता है?

(A.) Subroutines

(B.) Function

(C.) Files

(D.) Modules

Contact Us
JOIN US ON for Free Course +91-9027902171
Q52. ननम्नलिखित में से कौन सा एक षवलर्ष्ट वाक्यात्मक ब्लॉक है?

(A.) Subroutines

(B.) Function

(C.) Definition

(D.) Modules

Contact Us
JOIN US ON for Free Course +91-9027902171
Q53. What will be the output of the following Python function?

print('ab cd-ef'.title())

(A.) Ab cd-ef

(B.) Ab Cd-ef

(C.) Ab Cd-Ef

(D.) None of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q54. The variables in a function definition are called:
एक फ़ंक्शन पररभािा में वेररएबल्स को क्या कहा जाता है?

(A.) Subroutines

(B.) Function

(C.) Definition

(D.) Parameters

Contact Us
JOIN US ON for Free Course +91-9027902171
Q55. The values which are passed to a function definition are called:
वे वैल्यूज जो एक फ़ंक्शन पररभािा को पास की जाती हैं उन्हें क्या कहा जाता है?

(A.) Arguments

(B.) Subroutines

(C.) Function

(D.) Definition

Contact Us
JOIN US ON for Free Course +91-9027902171
Q56. Which of the following are mandatory to write the type annotations in
the function definition?
फ़ंक्शन पररभािा में प्रकार एनोरेर्न लििने के लिए ननम्नलिखित में से कौन सा अननवायड है?

(A.) Curly braces

(B.) Parentheses

(C.) Square brackets

(D.) Indentations

Contact Us
JOIN US ON for Free Course +91-9027902171
Q57. वे फ़ंक्शन्स जो एक ही तकों को पास करने पर सटीक पररणाम देते हैं उन्हें क्या कहा जाता
है? The functions which will give exact result when the same arguments are
passed are called:

(A.) Impure functions

(B.) Partial Functions

(C.) Dynamic Functions

(D.) Pure functions

Contact Us
JOIN US ON for Free Course +91-9027902171
Q58. वे फ़ंक्शन्स जो पास नकए गए तकों पर साइर् इफेक्ट्स र्ािते हैं उन्हें क्या कहा जाता है?
The functions which cause side effects to the arguments passed are called:

(A.) Impure functions

(B.) Partial Functions

(C.) Dynamic Functions

(D.) Pure functions

Contact Us
JOIN US ON for Free Course +91-9027902171
Q59. ननम्नलिखित कोर् द्वारा नकतने ऩंबर हप्रिं ट नकए जाए़ं गे?

(A.) 7 def fun(a, b):

(B.) 8 for x in range(a, b+1):


if x % 3 == 0:
(C.) 6
print(x, end=" ")
(D.) 9 fun(100, 120)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q60. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?
x=3
eval('x^2’)

(A.) Error

(B.) 1

(C.) 9

(D.) 6

Contact Us
JOIN US ON for Free Course +91-9027902171
Q61. Function defined to achieve some task as per the programmer’s
requirement is called a प्रोग्रामर की आवश्यकताओ ़ं के अनुसार नकसी कायड को प्राप्त करने
के लिए पररभाषित फ़ंक्शन को .......... कहा जाता है।

(A) user defined function

(B) library function

(C) built-in functions

(D) All of the above

Contact Us
JOIN US ON for Free Course +91-9027902171
Q62. What will be the output of the following code?

ननम्नलिखित कोर् का आउटपुट क्या होगा?


def iq(a, b):
(A) 9 if(a == 0):
(B) 10 return b
else:
(C) 11
return iq(a - 1, a + b)
(D) 12 print(iq(3, 6))

Contact Us
JOIN US ON for Free Course +91-9027902171
Q63. What will be the output of the following
example = "helle"

example.rfind("e")

(A) 1

(B) 2

(C) 4

(D) 5

Contact Us
JOIN US ON for Free Course +91-9027902171
Q64. What will be the output of the following Python code?
from math import *

floor(11.7)

(A) 12

(B) 11

(C) 11.0

(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q65. Python supports the creation of anonymous functions at runtime,
using a construct called ........... पायथन ........... नामक ननमाडण का उपयोग करके
रनटाइम पर अज्ञात कायों के ननमाडण का समथडन करता है।

(A) pi

(B) anonymous

(C) lambda

(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q66. What is the output of the following code?

ननम्नलिखित कोर् का पररणाम क्या है?

print(sum(1, 2, 3))

(A) 1

(B) 6

(C) 3

(D) Error in code

Contact Us
JOIN US ON for Free Course +91-9027902171
Q67. Given a string x = "hello" What is the output of x.count('l')?

एक स्टस्ट्ऱंग x = "hello" हदया गया है x.count('l') का आउटपुट क्या है?

(A) 1

(B) 2

(C) 0

(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q68. Choose the correct function declaration of func1() so that we can execute the
following two function calls successfully.

func1() की सही फ़ंक्शन घोिणा चुनें तानक हम ननम्नलिखित दो फ़ंक्शन कॉि को सफितापूवडक
ननष्पाहदत कर सकें।
func1(25, 75, 55)
(A) def fun1(kwargs)
func1(10, 20)
(B) def fun1(args*)

(C) No, it is not possible in Python

(D) def fun1(*data)


Contact Us
JOIN US ON for Free Course +91-9027902171
Q69. What is the output of the following Python code?

ननम्नलिखित पायथन कोर् का आउटपुट क्या है?

(A) 2 3 -3 3.3 from math import *


a = 2.19
(B) 3 4 -3 3
b = 3.999999
(C) 2 3 3 3 c = -3.30
(D) 2 3 -3 -3.3 print(int(a), floor(b), ceil(c), fabs(c))

Contact Us
JOIN US ON for Free Course +91-9027902171
Q70. To use a module in another module, you must import it using an ............ Statement

नकसी मॉड्यूि को दूसरे मॉड्यूि में उपयोग करने के लिए, आपको इसे ........... स्टेटमेंट का उपयोग करके इम्पोटड करना होगा।

(A) import

(B) include

(C) both a and b

(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q71. ननम्नलिखित में से कौन सा फ़ंक्शन केवि नेसेसरीिी को आग्युडमन्ट के रूप में एक्से्ट नहीं करता है?

Which of the following functions does not necessarily accept only iterables as arguments?

(A.) enumerate()

(B.) all()

(C.) chr()

(D.) max()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q72. ननम्नलिखित पायथन कोर् खिपेट का आउटपुट क्या होगा?

What will be the output of the following Python code snippet?


lamb = lambda x: x 3

print(lamb(5))

(A.) 15

(B.) 555

(C.) 125

(D.) None of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q73. मान िीजजए नक एक लिस्ट ऐसी है: l = [2,3,4] यहद हम इस लिस्ट को ररवसड ऑर्डर में हप्रिं ट करना चाहते हैं, तो
ननम्न में से नकस मेथर् का यूज़ नकया जाना चाहहए? Suppose there is a list such that l = [2,3,4]. If we
want to print this list in reverse order, which of the following methods should be used?

(A.) reverse(l)

(B.) list(reverse([l]))

(C.) reversed(l)

(D.) list(reversed(l))

Contact Us
JOIN US ON for Free Course +91-9027902171
Q74. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

float(' -12345\n')

(A.) -12345.0 (5 blank spaces before the number)

(B.) -12345.0

(C.) Error

(D.) -12345.0000000000…. (infinite decimal places)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q75. जब कोई आग्युडमेन्ट पास नहीं नकया जाता हैं, तो ननम्नलिखित में से कौन से फ़ंक्शन में एरर आएगा?

Which of the following functions will not result in an error when no arguments are passed to it?

(A.) min()

(B.) divmod()

(C.) all()

(D.) float()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q76. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

hex(15)

(A.) f

(B.) 0xF

(C.) 0Xf

(D.) 0xf

Contact Us
JOIN US ON for Free Course +91-9027902171
Q77. ननम्नलिखित में से कौन सा फ़ंक्शन एरर नहीं देता है?

Which of the following functions does not throw an error?

(A.) ord()

(B.) ord(' ')

(C.) ord('')

(D.) ord("")

Contact Us
JOIN US ON for Free Course +91-9027902171
Q78. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

len(["hello", 2, 4, 6])

(A.) 4

(B.) 3

(C.) Error

(D.) 6

Contact Us
JOIN US ON for Free Course +91-9027902171
Q79. Sys.argv में प्रत्येक एलिमें्स का प्रकार क्या है?

What is the type of each element in sys.argv?

(A.) set

(B.) list

(C.) tuple

(D.) string

Contact Us
JOIN US ON for Free Course +91-9027902171
80. Sys.argv की िम्बाई क्या है?

What is the length of sys.argv?

(A.) number of arguments

(B.) number of arguments + 1

(C.) number of arguments – 1

(D.) none of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q81. Which of the following functions is a built-in function in Python?

ननम्नलिखित में से कौन सा फ़ंक्शन पायथन में एक षबल्ट-इन फ़ंक्शन है?

(A) factorial()

(B) print()

(C) seed()

(D) sqrt()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q1. What will be the output after the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?

(A) (14, 5) def abc(m, n):


(B) 145 print(m n)
abc(14, 5)
(C) m n

(D) 9

Contact Us
JOIN US ON for Free Course +91-9027902171
Q2. What will be the output after the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?

(A) 150 def abc(m=15, n=10, o=5):


print(m * n + o)
(B) 155
abc()
(C) 0

(D) 225

Contact Us
JOIN US ON for Free Course +91-9027902171
Q3. What will be the output after the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?


def abc(m, n):

return m * n

print(abc(7, 3))

(A) 21

(B) 7, 3

(C) (7, 3)

(D) m * n

Contact Us
JOIN US ON for Free Course +91-9027902171
Q4. What will be the output after the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?


def p(m, n):

return m / n

o = p(50, 5)

print(o)

(A) 5

(B) 50 / 5

(C) 10.0

(D) 10

Contact Us
JOIN US ON for Free Course +91-9027902171
Q5. What will be the output after the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?


def abc(m, n):

print(m m n)

abc(14, 5)

(A) (14, 5)

(B) -5

(C) m n

(D) Error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q6. What will be the output after the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?


def abc(m=15, n=10, o=5):

print(m * n % 10 + o)

abc()

(A) 150

(B) 155

(C) 1.0

(D) 225

Contact Us
JOIN US ON for Free Course +91-9027902171
Q7. What will be the output after the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?

m = lambda n: n 3

print(m(6))

(A) 6

(B) 18

(C) 36

(D) 216

Contact Us
JOIN US ON for Free Course +91-9027902171
Q8. What will be the output of the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?

import math

print(math.floor(67.3))

(A) 67

(B) 68

(C) 67.0

(D) 68.0

Contact Us
JOIN US ON for Free Course +91-9027902171
Q9. What will be the output of the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?

import math

print(math.ceil(21.4))

(A) 21

(B) 22

(C) 21.0

(D) 22.0

Contact Us
JOIN US ON for Free Course +91-9027902171
Q10. What will be the output of the following statements?

ननम्नलिखित स्टेटमेंट के बाद आउटपुट क्या होगा?

import math

print(math.sqrt(4))

(A) 2.1

(B) 2

(C) 2.0

(D) 4.0

Contact Us
JOIN US ON for Free Course +91-9027902171
Q11. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?


import math

x = abs(math.sqrt(25))

print(x)

(A) Error

(B) -5

(C) 5

(D) 5.0

Contact Us
JOIN US ON for Free Course +91-9027902171
Q12. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

sum(2, 4, 6)

sum([1, 2, 3])

(A) Error, 6

(B) 12, Error

(C) 12, 6

(D) Error, Error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q13. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

all([3, 0, 4.2])

(A) True

(B) False

(C) Error

(D) 0

Contact Us
JOIN US ON for Free Course +91-9027902171
Q14. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

min(max(False, -3, -4), 2, 7)

(A) 2

(B) False

(C) -3

(D) -4

Contact Us
JOIN US ON for Free Course +91-9027902171
Q15. फ़ंक्शन complex() का आउटपुट क्या है?

What is the output of the function complex()?

complex()

(A) 0j

(B) 0 + 0j

(C) 0

(D) Error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q16. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

complex(1 + 2j)

(A) Error

(B) 1

(C) 2j

(D) 1 + 2j

Contact Us
JOIN US ON for Free Course +91-9027902171
Q17. ननम्नलिखित में से कौन सा फ़ंक्शन पायथन में एक अ़ं तननि हहत फ़ंक्शन है?

Which of the following functions is a built-in function in Python?

(A) seed()

(B) sqrt()

(C) factorial()

(D) print()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q18. फ़ंक्शन pow(x,y,z) का मूल्या़ंकन इस प्रकार है:

The function pow(x,y,z) is evaluated as:

pow(x, y, z)

(A) (xy)z

(B) (xy) / z

(C) (xy) % z

(D) (xy) * z

Contact Us
JOIN US ON for Free Course +91-9027902171
Q19. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

all([2, 4, 0, 6])

(A) Error

(B) True

(C) False

(D) 0

Contact Us
JOIN US ON for Free Course +91-9027902171
Q20. ननम्नलिखित पायथन एक्सप्रेर्न का आउटपुट क्या होगा?

What will be the output of the following Python expression?

round(4.5676, 2)

(A) 4.5

(B) 4.6

(C) 4.57

(D) 4.56

Contact Us
JOIN US ON for Free Course +91-9027902171
Q21. What will be the output of the following statements?

ननम्नलिखित स्टेटमेंट का आउटपुट क्या होगा?


import math

print(math.pow(3,2))

(A) 6

(B) 9

(C) 6.0

(D) 9.0

Contact Us
JOIN US ON for Free Course +91-9027902171
Q22. What does the following statements do?

ननम्नलिखित कथन क्या करते हैं?


import datetime

print(datetime.datetime.today())

(A) Displays current date and time

(B) Displays a list of all the hours remaining till midnight

(C) Displays a random time from today's date

(D) Displays today's weekday name

Contact Us
JOIN US ON for Free Course +91-9027902171
Q23. What does the following statements do?

ननम्नलिखित कथन क्या करते हैं?


from datetime import *

print(getattr(datetime.today(), 'hour'))

(A) Displays current date and time

(B) Displays a list of all the hours remaining till midnight

(C) Displays current hour of the day

(D) Displays the number of hours in a day

Contact Us
JOIN US ON for Free Course +91-9027902171
Q24. What does the following statements do?

ननम्नलिखित कथन क्या करते हैं?


from datetime import *

print(getattr(datetime.today(), 'year'))

(A) Displays current date and year

(B) Displays current year

(C) Displays the number of months in a year

(D) Displays the number of days in a year

Contact Us
JOIN US ON for Free Course +91-9027902171
Q25. What does the following statements do?

ननम्नलिखित कथन क्या करते हैं?


from datetime import *

print(datetime.today().strftime('%A'))

(A) Displays the full month name

(B) Displays the abbreviated month name

(C) Displays the abbreviated day name

(D) Displays the full weekday name

Contact Us
JOIN US ON for Free Course +91-9027902171
Q26. What does the following statements do?

ननम्नलिखित कथन क्या करते हैं?


from datetime import *

print(datetime.today().strftime('%B'))

(A) Displays the full weekday name

(B) Displays the full month name

(C) Displays the abbreviated day name

(D) Displays the abbreviated month name

Contact Us
JOIN US ON for Free Course +91-9027902171
Q27. What does the following statements do?

from datetime import *

print(datetime.today().strftime('%d'))

(A) Displays the hour number of 12-hour clock

(B) Displays the date and time appropriate for locale

(C) Displays the day of the month number (from 01 to 31)

(D) Displays the microsecond number (from 0 to 999999)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q28. What will be the output of the following statements?

ननम्नलिखित स्टेटमेंट का आउटपुट क्या होगा?


x = 'Python'

print(x.capitalize())

(A) Python

(B) Python.capitalize

(C) PYTHON

(D) Python

Contact Us
JOIN US ON for Free Course +91-9027902171
Q29. What will be the output of the following statements?

ननम्नलिखित स्टेटमेंट का आउटपुट क्या होगा?


x = 'python job interview'

print(x.title())

(A) python job interview

(B) Python job interview

(C) Python Job Interview

(D) Python job Interview

Contact Us
JOIN US ON for Free Course +91-9027902171
Q30. What will be the output of the following statements?

ननम्नलिखित स्टेटमेंट का आउटपुट क्या होगा?


x = 'python jobs'

print(x.upper())

(A) PYTHON JOBS

(B) Python jobs

(C) Python Jobs

(D) python jobs


Contact Us
JOIN US ON for Free Course +91-9027902171
Q31. How are keyword arguments specified in the function heading?

फ़ंक्शन हेनर्िं ग में कीवर्ड आग्युडमेंट कैसे स्पेजसफाइर् नकए जाते हैं?

(A) one-star followed by a valid identifier

(B) one underscore followed by a valid identifier

(C) two stars followed by a valid identifier

(D) two underscores followed by a valid identifier

Contact Us
JOIN US ON for Free Course +91-9027902171
Q32. What will be the output of the following Python code?

ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?

(A) 1 3 def foo(fname, val):


print(fname(val))
(B) 3 1
foo(max, [1, 2, 3])
(C) error foo(min, [1, 2, 3])
(D) none of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q33. What will be the output of the following Python code?

ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?

(A) Error def f1():


x = 100
(B) 100
print(x)
(C) 101 x=x+1
(D) 99 f1()

Contact Us
JOIN US ON for Free Course +91-9027902171
Q34. Find the output of the following Python program.

ननम्नलिखित पायथन प्रोग्राम का आउटपुट ज्ञात करें।

def gfg(x, 1=[]):


(A) [3, 2, 1, 0, 1, 4]
for i in range(x):
(B) [0, 1] 1.append(i * i)
(C) [0, 1, 0, 1, 4] print(1)
gfg(2)
(D) Error in code

Contact Us
JOIN US ON for Free Course +91-9027902171
Q35. Suppose t = (1, 2, 4, 3), which of the following is incorrect?

मान िीजजए t = (1, 2, 4, 3), ननम्नलिखित में से कौन सा गित है?

(A) print(t[3])

(B) t[3] = 45

(C) print(max(t))

(D) print(len(t))

Contact Us
JOIN US ON for Free Course +91-9027902171
Q36. Which of the following statements is false about recursion?

ररकसडन के बारे में ननम्नलिखित में से कौन सा कथन असत्य है?

(A) Every recursive function must have a base case

(B) Infinite recursion can occur if the base case is not properly mentioned

(C) A recursive function makes the code easier to understand

(D) Every recursive function must have a return value

Contact Us
JOIN US ON for Free Course +91-9027902171
Q37. The output of the following Python program is...

ननम्नलिखित पायथन प्रोग्राम का आउटपुट है...


r = lambda q: q * 2
(A) 24 s = lambda q: q * 3
(B) 48 x=2
x = r(x)
(C) 64
x = s(x)
(D) Error in code x = r(x)
print(x)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q38. Recursive functions usually take __________ memory space than non-recursive functions.

ररकजसि व फ़ंक्शन आमतौर पर नॉन-ररकजसि व फ़ंक्शन की तुिना में __________ मेमोरी स्पेस िेते हैं।

(A) More

(B) Less

(C) Can’t say

(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q39. The __________ can be accessed only inside the function in which they are declared, whereas global variables can be accessed
throughout the program body by all functions.

__________ को केवि उस फ़ंक्शन के अ़ं दर एक्सेस नकया जा सकता है जजसमें वे घोषित नकए गए हैं, जबनक ग्लोबि वेररएबल्स को सभी फ़ंक्शन्स द्वारा पूरे प्रोग्राम बॉर्ी में
एक्सेस नकया जा सकता है।

(A) Global variables

(B) Local variables

(C) Can’t say

(D) None

Contact Us
JOIN US ON for Free Course +91-9027902171
Q40. In-built function of Python is used to remove all the leading and trailing spaces from a string.

पायथन के इन-षबल्ट फ़ंक्शन का उपयोग एक स्टस्ट्ऱंग से सभी प्रमुि और अनुगामी ररक्त स्थान को हटाने के लिए नकया जाता है।

(A) lstrip()

(B) trail()

(C) strip()

(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q41. method returns `True` if all characters in the string are alphanumeric (either
alphabets or numbers). If not, it returns false. यहद स्टस्ट्ऱंग में सभी वणड अल्फान्यूमेररक (या तो अक्षर या
स़ंख्या) हैं, तो षवषि `True` ररटनड करता है यहद नहीं, तो यह false िौटाता है।

(A) isalphanum()

(B) isalnum()

(C) isalphannumeric()

(D) None

Contact Us
JOIN US ON for Free Course +91-9027902171
Q42. एक स्टस्ट्ऱंग को रीर् करने के लिए आप नकस फ़ंक्शन का उपयोग करते हैं?

Which function do you use to read a string?

(A) input("Enter a string")

(B) eval(input("Enter a string"))

(C) enter("Enter a string")

(D) eval(enter("Enter a string"))

Contact Us
JOIN US ON for Free Course +91-9027902171
Q43. ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?

print("xyyzxyzxxyy".count('yy'))

(A) 2

(B) 0

(C) error

(D) none of the mentioned

Contact Us
JOIN US ON for Free Course +91-9027902171
Q44. __________ method calls the built-in Python help system.

__________ मेथर् षबल्ट-इन पायथन हे् जसस्टम को कॉि करता है।

(A) helpview()

(B) help()

(C) helpme()

(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q45. __________ method converts all uppercase characters to lowercase and vice versa of
the given string, and returns it. __________ षवषि सभी अपरकेस वणों को हदए गए स्टस्ट्ऱंग के िोअरकेस
और इसके षवपरीत में पररवषति त करती है, और इसे वापस करती है।

(A) uppertolower

(B) isUpper

(C) toUpper

(D) swapcase

Contact Us
JOIN US ON for Free Course +91-9027902171
Q46. What is the output of the following program?

ननम्नलिखित प्रोग्राम का आउटपुट क्या है?


def myfunc(a):
(A) 8 a=a+2
(B) 16 a=a*2
return a
(C) Indentation Error
print(myfunc(2))
(D) Runtime Error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q47. Function name and parameter list are part of function header.

फ़ंक्शन का नाम और पैरामीटर लिस्ट फ़ंक्शन हेर्र का हहस्सा हैं।

(A) True

(B) False

(C) Can’t say

(D) None of these

Contact Us
JOIN US ON for Free Course +91-9027902171
Q48. The function used to find power of a number.

ऩंबर का पॉवर फाइ़ं र् करने के लिए नकस फ़ंक्शन का प्रयोग करते हैं।

(A) ``

(B) power()

(C) pow()

(D) a and c both

Contact Us
JOIN US ON for Free Course +91-9027902171
Q49. फ़ंक्शन के हेनर्िं ग में नर्फॉल्ट आग्युडमेंट कैसे स्पेजसफाइर् नकए जाते हैं?

How are default arguments specified in the function heading?

(A) identifier followed by an equal to sign and the default value

(B) identifier followed by the default value within backticks (`)

(C) identifier followed by the default value within square brackets ([])

(D) identifier

Contact Us
JOIN US ON for Free Course +91-9027902171
Q50. ननम्नलिखित पायथन कोर् खिपेट का आउटपुट क्या होगा?

print('abc'.islower())

(A) True

(B) False

(C) None

(D) Error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q51. ननम्नलिखित पायथन कोर् खिपेट का आउटपुट क्या होगा?

What will be the output of the following Python code?

print('Hello World'.istitle())

(A) True

(B) False

(C) None

(D) Error

Contact Us
JOIN US ON for Free Course +91-9027902171
Q52. ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?

What will be the output of the following Python code?

print('xyyzxxyyy'.lstrip('xyy'))

(A) error

(B) zxxyxyyy

(C) z

(D) zxxy

Contact Us
JOIN US ON for Free Course +91-9027902171
Q53. ननम्नलिखित पायथन कोर् खिपेट का आउटपुट क्या होगा?

What will be the output of the following Python code snippet?

print('Ab!2'.swapcase())

(A) AB!@

(B) ab12

(C) aB!2

(D) aB1@

Contact Us
JOIN US ON for Free Course +91-9027902171
Q54. ननम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?

What will be the output of the following Python function?

list(enumerate([2, 3]))

(A) Error

(B) [(1, 2), (2, 3)]

(C) [(0, 2), (1, 3)]

(D) [(2, 3)]

Contact Us
JOIN US ON for Free Course +91-9027902171
Q55. ननम्नलिखित पायथन कोर् का आउटपुट क्या होगा?

What will be the output of the following Python code?

def printMax(a, b):


(A) 3
if a > b:
(B) 4 print(a, "is maximum")
elif a == b:
(C) 4 is maximum print(a, "is equal to ", b)
else:
(D) None of these
print(b, "is maximum")
printMax(3, 4)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q56. ननम्नलिखित पायथन प्रोग्राम का आउटपुट क्या होगा?

What will be the output of the following Python program?

(A) 5 def addItem(listParam):


listParam += [1]
(B) 8
mylist = [1, 2, 3, 4]
(C) 2 addItem(mylist)
(D) 1 print(len(mylist))

Contact Us
JOIN US ON for Free Course +91-9027902171
Q57. ननम्नलिखित कोर् का आउटपुट क्या है?

What is the output of the following code?

(A) Hello WordWordWordWordWord def say(message, times = 1):

(B) Hello Word 5 print(message * times)

(C) Hello Word, Word, Word, Word, Word say("Hello")

(D) Hello HelloHelloHelloHelloHello say("Word", 5)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q58. मेमोरी का कौन सा भाग जसस्टम फ़ंक्शन कॉि के पैरामीटर और स्थानीय चर को स़ंग्रहहत करता है?

Which part of the memory does the system store the parameter and local variables of a function
call?

(A) Heap

(B) Stack

(C) Uninitialized data segment

(D) None of the above

Contact Us
JOIN US ON for Free Course +91-9027902171
Q59. ननम्नलिखित कोर् का आउटपुट क्या है?

What is the output of the following code?

(A) 11 def fun(a, b = 6):

(B) 9 a=a+b

(C) 5 print(a)

(D) 4 fun(5, 4)

Contact Us
JOIN US ON for Free Course +91-9027902171
Q60. ननम्नलिखित पायथन कोर् का आउटपुट क्या है?

What will be the output of the following Python code?

(A) a BCD x = 'abcd'


for i in x:
(B) abcd
print(i.upper())
(C) error

(D) A B C D

Contact Us
JOIN US ON for Free Course +91-9027902171
THaNK You!
Contact Us
JOIN US ON for Free Course +91-9027902171

You might also like