Subscribe Us

Responsive Advertisement

Advertisement

python mcqs set 3

 


python mcqs set 3 




1. Which of the following is a Python tuple? निम्नलिखित में से कौन एक पायथन टपल है?

 

A. [3]

B. {1,2,3}

C. (1, 2, 3, 4)

D. None of the above इनमें से कोई नहीं

 

2. What will be the output of the following code snippet? निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?

 

a=1  while True:     if a%7==0:        break     print(a) a+=1

 

A. 1234

Β. 12345

C. 123456

D. 1234567

 

3. What will be the output of the following code snippet? निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?

z="abc" j="j" while j in z:     print(j, end=" ")

 

A. abc

B. ABC

C. No output कोई आउपुट नहीa

D. None of these इनमें से कोई नहीं

 

4...... is the output you get when '2'==2 is executed-........वह आउटपुट है जो आपको तब मिलता है जर '2'-2 निष्पादित होता है।

 

A. True

B. False

C. ValueError occurs

D. TypeError occurs

 

5. What will be the output of the following? निम्नलिखित का आउटपुट क्या होगा?

 

a = 12.6

b=2

print (a//b)

 

A. 6.3

B. 6.0

C. 7

D. None

 

6. Suppose list1 is [1, 3, 2], What is list1 * 2? मान लीजिए लिस्ट 1 [1, 3, 2], है, लिस्ट 1*2 क्या है?

 

A. [2, 6, 4]

B. [1, 3, 2, 1, 3, 2]

C. [1, 3, 2, 3, 2, 1]

D. None of the above इनमें से कोई नहीं

 

7. What will be the output of the following python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?                               

>>>max("what are you")

 

A. error

 

B. 'y'

C. t

D. None of the above. इनमें से कोई भी नहीं

 

8. Identify the correct sequence of steps to run a program.एक प्रोग्राम को रन करने के लिए स्टेप्स के सही सीक्वेंस की पहचान करें।

 

A. Link, load, Code, Compile, & Execute लिंक, लोड, कोड, कम्पाइल, एवं एक्सीक्यूट

B. Code, Compile, Link, Execute & load कोड, कम्पाइल, लिंक, एक्सीक्यूट एवं लोड

C. Code, Compile, Link, load& Execute कोड, कम्पाइल, लिंक, लोड, एवं एक्सीक्यूट

D. Compile, Code, Link, load & Execute कम्पाइल, कोड, लिंक, कोड, एवं एक्सीक्यूट

 

9. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

i = 1 while True:     if i%2==0:         break       print(i) 1 += 2

 

A. 1

B. 12589

C. 13579 11 .......

D. None

 

10. Which will be the output of the following Python expression if x=56.236. निम्न में से कौन सा इस प्रोग्राम का आउटपुट होगा?

 

print("%.2f"%x)

 

A. 56.236

B. 56.23

C. 56.0000

D. 56.24

 

11. The meaning of bug is a - बग का एक अर्थ है-

 

A. difficult syntax error in a program एक प्रोग्राम में मुश्किल सिन्टैक्स एरर

B. logical error in a programm एक प्रोग्राम में लॉजिकल एरर

C. Both a and b a तथा b दोनों

D. All of the above उपर्युक्त सभी

 

12. What will be the output of the following code snippet?निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?

i=0    while i<5: print(i) i+=1 if i==3: break else: print(0)

 

A. 012

B. 0123

C. 01234

D. 321

 

13. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

a=[13,56,17]

a.append([87])

a.extend([45,67])

print(a)

 

A. [13, 56, 17, 87, [45, 67]]

B. [13, 56, 17, 87, 45, 67]

 

C. [13, 56, 17, [87], 45, 67]

D. None of the above. इनमें से कोई नहीं

 

14. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा? >>>print(ord('h')-ord('z'))

 

A. 17

B. -17

C. 18

D. -18

 

15. Which of the following commands will create a list?निम्नलिखित में से कौन सा कमांड एक सूची बनाएगा?

 

A. list1=list()

B. list1 =

C. list1=list([1,2,3])

D. All of the above - उपरोक्त सभी

 

16. Which of the following is the output of this program? निम्नलिखित में से कौन इस प्रोग्राम का आउटपुट है?

True = False while True: print (True) break

 

A. True

B. False

C. Error

D. None of these इनमें से कोई नहीं

 

17. Which of the following is the output of this program? निम्नलिखित में से कौन सा इस प्रोग्राम का आउटपुट है?

 

i=1 while False: if i%2==0: break print(i) i+=2

 

A. 1

Β. 1357...

C. 1234

D. None of the above उपर्युक्त में से कोई नहीं

 

 

18. Which of the following is the output of this program? निम्नलिखित में से कौन सा इस प्रोग्राम का आउटपुट है? i=5 while True: if i%0011==0: break print(i) i+=1

 

Α. 56789 10

B. 5678

C. 56

D. None of these इनमें से कोई नहीं

 

 

19. Which of the following mode argument is used to truncate? निम्न में से किन मोड आर्गुमेन्ट का उपयोग ट्रनकेट करने के लिए उपयोग किया जाता है?

 

A. a

B. f

C. W

D. t

 

20. Which of the following is the output of this program? निम्नलिखित में से कौन सा इस प्रोग्राम का आउटपुट है?

i=1 while True: if i%007--0: break print(i) i+=1

 

Α. 123456

Β. 1234567

C. 12345

D. Error

 

21. Which of the following expression value is correct. निम्नलिखित में से कौन सा एक्सप्रेशन वैल्यू सही है।

 

A. 3*(2*2)=81

B. 1*(3*2)=1

C. (2*2)*2=16

D. All of the above उपर्युक्त सभी

 

22. Which of the following is the output of this program? निम्नलिखित में से कौन सा इस प्रोग्राम का आउटपुट है? i=5 while True: if i%009==0; break print(i) i+=1

 

A. 5678

B. 56789

C. SyntaxError: Invalid digit '9' in octal literal

D. None of these इनमें से कोई नहीं

 

23. What will be the output of the following Python code? निम्नलिखित पायधन कोड का आउटपुट क्या होगा?

 

i=2

while True:

if i%3==0:

break

print(i)

i+=2

 

A. 246810 ...

B. 24

C. 23

D. error

 

 24. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा? >>>t = (1, 2, 4, 3, 8, 9)

 

>>>[t[i] for i in range (0, len (t), 2)]

 

A. [2.3.9]

8. [1,2,4,3,8,9]

C [1.4.8]

D. None of the above उपरोक्त में से कोई नहीं

 

25. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

>>>print (0xA + 0xB+ 0xC)

 

A 0xA0xB0xC

B. Error

C 0x22

D. 33

 

26. 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

 

27. What will be the output of the following Python function? निम्नलिखित पायथन फंक्शन का आउटपुट क्या होगा?

 

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

 

A. Error

 B. True

C. False

D. 4>2

 

28. The part of a machine level instruction,which tells the central processor what has to be done is........ मशीन लेवल निर्देश का एक हिस्सा, जो सेंट्रल प्रोसेसर को बताता है कि क्या करना है...

 

A. A logical code एक लॉजिकल कोड

B. An operand एक ऑपरेंड

C. An operation एक ऑपरेशन

D. All of the above उपर्युक्त सभी

 

29. Suppose t=(1, 2, 4, 3), which of the following is incorrect? मान लीजिए = (1, 2, 4, 3). निम्नलिखित में से कौन-सा गलत है?

 

A. print(t[3])

B. [3]=45

C. print(max(t))

 

D. print(len(t))

 

30. Which of the following items are present in the function header?निम्न में से कौन सा आइटम फंक्शन हे़डर में प्रेसेन्ट है।

 

A. function name फंक्शन नेम

B. function name and parameter list फंक्शन नेम और पैरामीटर लिस्ट

C. parameter list पैरामीटर लिस्ट

D. return value रिटर्न वैल्यू

 

31. Which of the following is a Python tuple? निम्नलिखित में से कौन एक पायथन टपल है?

 

A. [1,2,3]

B. (1,2,3)

 C. {1,2,3}

D. {}

32. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

>>>t=(1,2,4,3) >>>t [1:3]

 

A. (1,2)

Β. (1,2,4)

C. (2,4)

D. (2,4.3)

 

33. What is returned by math.ceil(3.4)? math.ceil (3.4) का रिटर्न क्या होगा?

 

A. 3

B. 4

C. 4.0

D. 3.0

 

34. Following is true for understanding of a problem. किसी समस्या की समझ के लिए निम्नलिखित सत्य है।

 

A. knowing the knowledgebase नालेजबेस को जानना

B. understanding the subject on which the problem is based. उस विषय को समझना जिस पर समस्या आधारित है

C. communication with the client ग्राहक के साथ संचार

D. all of the above उपर्युक्त सभी

 

35. What is the type of each element in sys.argv? sys.argv में प्रत्येक एलिमेन्ट का टाइप क्या है?

 

A. set-सेंट

B. list लिस्ट

C. tuple टपल

D. string - स्ट्रिंग

 

 

36. Which predefined Python function is used to find length... किस पूर्वनिर्धारित पायथन फंक्शन का उपयोग लंबाई को फाइन्ड के लिए किया जाता है।

 

A. length

B. length()

C. len()

D. None

 

37. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा? >>>t=(1,2,4,3) >>>t[1:-1]

 

A. (1,2)

B. (1,2,4)

C. (2,4)

D. (2,4,3)

 

38. To open a file c:\balaji.txt for reading, we use .........पढ़ने के लिए एक फाइल c:\balaji.txt खोलने के लिए; हम....... का उपयोग करते हैं।

 

A. infile = open("c:\balaji.txt", "r")

B. infile = open("c:\\balaji.txt", "r")

C. infile = open(file = "c: \balaji.txt", "r")       

 D. None of the above. - इनमें से कोई भी नहीं

 

39. Which of the following statements create a dictionary? निम्नलिखित में से कौन सा कथन एक डिक्शनरी बनाता है?

 

 A. d = {}

B. d = {"john":40, "peter":45)

C. d = {40:"john", 45:"peter"}

D. All of the mentioned उल्लिखित सभी

 

40 . The function which reads one line from standards input and returns it as a string (removing the trailing newline) वह फंक्शन जो स्टैण्डर्ड इनपुट से एक पंक्ति रीड करता है और इसे स्ट्रिंग के रूप में लौटाता है (ट्रेलिंग न्यूलाइन को हटाते हुए)

 

A. raw_input - रॉ_इनपुट

 

B. input इनपुट

C. eval - ईवल

D. accept एक्सेप्ट

 

41. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

 def foo(k): k[0]= 1

q = [0] foo(q)

print(q)

 

A. [1]

B. [0,1]

C. [1,0]

D. [0]

 

42. Where is function defined? फंक्शन को कहां डिफाइन किया जाता है?

 

 A. In Module मॉड्यूल

B. In Class क्लास

C. In Another function एक और फंक्शन

D. All of these. उपर्युक्त सभीं

 

43. Which operator is used in Python to import modules from packages? पैकेज से मॉड्यूल आयात करने के लिए पायथन में किस ऑपरेटर का उपयोग किया जाता है?

A.  .

B. *

C. ->

D. &

 

44. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

>>>t= (1, 2)

>>>2 * t

 

A. (1,2,1,2)

B. [1, 2, 1,2]

C. (1,1,2,2)

D. [1, 1, 2, 2]

 

45. Which of the following argument we need to pass in reshape() function. निम्नलिखित में से कौन सा आर्नुमेन्ट हमें reshape() फंक्शन में पास करने की आवश्यकता होती है।

 

A. Shape शेप

B. Array ऐरे

C. both a) and b) a) तथा b) दोनों

D. None of the above. इनमे से कोई भी नहीं

 

46. What is called when a function is defined inside a class? जब किसी फंक्शन को किसी क्लास के अंदर डिफाइन किया जाता है तो उसे क्या कहते हैं?

 

A. class - क्लॉस

B. function फंक्शन

C. method-मेथड

D. module - मॉडुल

 

47. Advantage of using FlowCharts are: फ्लोचार्ट का उपयोग करने का लाभ है:

 

A. Effective Analysis प्रभावी विश्लेषण

B. Proper documentation उचित डॉक्युमेन्ट

C. Efficient Coding कुशल कोडिंग

D. All of the above सपर्युक्त सभी

 

48. Lambda is a function in python? लैम्ब्डा पायथन में एक फंक्शन है?

 

A. True- ट्रू

B. False फॉल्स

C. Lambda is a function in python but user can not use it. लैम्या पायथन में एक फंक्शन है लेकिन उपयोगकर्ता इसका उपयोग नहीं कर सकता।

D. None of the above उपर्युक्त में से कोई नहीं

 

49. Assignment Operator is एसाइन्मेंट आपरेटर है:

 

A. #

B. =

C. /

D. &

 

50. The code block within every function starts with a_? प्रत्येक फंक्शन के भीतर एक कोड ब्लॉक से शुरू होता है?

 

A. ;

B. ::

C. :

D. %

 

51. Which of the following expressions results in an error? निम्नलिखित में से किस एक्सप्रेशन के परिणामस्वरूप त्रुटि होती है?

 

A. float('10')

B. int('10.8')

C. int('10')

D. float('10.8')

 

52. The errors that can be pointed out by the complier are... कंपाइलर द्वारा बताये जा सकने वाले एरर हैं.

 

A. Semantic errors सिमेटिक एरर

B. Syntax errors सिन्टैक्स एरर

C. Logical errors लॉजिकल एरर

D. All of the above उपर्युक्त सभी

 

53. If return statement is not used inside the function, the function will return: यदि फंक्शन के अंदर रिटर्न स्टेटमेंट का उपयोग नहीं किया जाता है, तो फंक्शन रिटर्न करेगाः

 

A. None

B. 0

C. Null

D. Arbitary value

 

54. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

def cube(x):

    return x*x*x

x= cube(5)

print (x)

 

A. 26

B. 525

C. 125

D. None of these. इनमें से कोई नहीं

 

55. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा? >>>t1 = (1, 2, 4, 3) >>>t2 =  (1, 2, 3, 4) >>>t1 < t2

 

A. True - टू

B. False फॉल्स

C. Error - एरर

D. None कोई नहीं

 

56. What is the order of precedence in python? पायथन में प्रेसीडेन्सी का क्रम क्या है?

 

i) Parentheses - कोष्ठक

ii) Exponential - घातीय

iii) Multiplication - गुणन

iv) Division - विभाजन

v) Addition - जोड़

vi) Subtraction - घटाव

 

A. i,ii, iii, iv,v,vi

B. ii,i,iii, iv,v,vi

C.ii,i,iv,iii,v,vi

D. i, ii, iii, iv,vi,v

 

 

57. Which of the following function headers is correct?निम्नलिखित में से कौन सा फंक्शन हेडर सही है?

 

A. def fun(a = 2, b = 3, c)

B. def fun(a = 2, b, c = 3)

C. def fun(a, b = 2, c = 3)

D. def fun(a, b, c = 3, d)

 

 

58. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा? def printMax(a, b): if a > b: print(a, 'is maximum') elif a ==b: print(a, 'is equal to', b) else: print(b, 'is maximum') printMax(3, 4)

 

A. 3

B. 4

C. 4 is maximum

D. None of the mentioned उल्लिखित कोई नहीं

 

 

59. What is the maximum possible length of an identifier for better redability? - एक आइडेंटिफायर की अधिकतम संभव लंबाई क्या है?

 

A. 31 characters 31 कैरेक्टर

B. 63 characters 63 कैरेक्टर

C. No limit but 79 characters for better redability कोई सीमा नहीं परन्तु 79 कैरेक्टर

D. All of the above. उपर्युक्त में से कोई नहीं

 

60. What is the output of the following program? निम्नलिखित प्रोग्राम का आउटपुट क्या है?

 

z = lambda x: x * X

print (z(6))

 

A. 6

B. 36

C. 0

D. Error

 

61. What will be the output of the following Python code?निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

d1 = {"john":40, "peter":45} d2 = {"john":466, "peter":45} d1 > d2

 

A. True- ट्रू

B. False - फाल्स

C. Error - एरर

D. None - कोई नहीं

 

62. Which of the following is a feature of DocString?bनिम्नलिखित में से कौन सी DocString की एक विशेषता है?

 

A. Provide a convenient way of associating documentation with Python modules, functions, classes, and methods. पायथन मॉड्यूल, फंक्शनो, क्लॉसो और मेथेडो के साथ डाक्यूमेन्टेशन को जोड़ने का एक सुविधाजनक तरीका प्रदान करता है।

B. All functions should have a docstring. सभी फंक्शनो में एक डॉकस्ट्रिंग होना चाहिए

C. Docstrings can be accessed by the doc_attribute on objects. Docstrings को ऑब्जेक्ट पर _doc ऐट्रीब्यूट द्वारा एक्सेस किया जा सकता है।

D. All of the mentioned. उल्लिखित सभी

 

63. Which of the following is attributes of file? निम्नलिखित में से कौन सा फाइल का ऐट्रीब्यूट है?

 

A. closed - क्लोज्ड

B. softspace - सॉफ्टस्पेस

C. name - नेम

D. All of the above. - उपर्युक्त सभी

 

64. Which one of the following is the correct way of calling a function? निम्नलिखित में से कौन-सा एक फंक्शन को कॉल करने का सही तरीका है?

 

A. function_name()

B. call function_name().

C. ret function_name()

D. function function_name()

 

65. What will be the output of the following Python code?निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

def func(a, b=5, c=10): print('a is', a, 'and b is', b, 'and c is', c)

func (3, 7) func (25, c=24) func(c=50, a=100)

 

A. a is 7 and b is 3 and c is 10 a is 25 and b is 5 and e is 24 a is 5 and b is 100 and c is 50

B. a is 3 and b is 7 and c is 10 a is 5 and b is 25 and c is 24 a is 50 and b is 100 and c is 5

C. a is 3 and b is 7 and c is 10 a is 25 and b is 5 and c is 24 a is 100 and b is 5 and c is 50

D. None of the mentioned उल्लिखित कोई नहीं

 

66. What type of data is: किस प्रकार का डेटा है: a=[(1,1),(2,4),(3,9)]?

 

A. Array of tuples

B. List of tuples

 

C. Tuples of lists

D. Invalid type

 

 

67........ are the arguments passed to a function in correct positional order. सही स्थिति क्रम में किसी फंक्शन को दिए गए आर्गुमेन्ट हैं।

 

A. Required arguments आवश्यक आर्गमेन्ट

B. Keyword arguments कीवर्ड आर्गमेन्ट

C. Default arguments डिफॉल्ट आर्गुमेन्ट

D. Variable-length arguments वेरियेबिल लेंग्थ आर्गुमेन्ट्स

 

 

68. Actual instructions in flowcharting are represented in ......पलोचार्टिंग में वास्तविक निर्देशों का प्रतिनिधित्व में किया जाता है।

 

A. Boxes बॉक्स

B. Circles सर्किल

C. Arrows - एरो

D. All of the above - उपर्युक्त सभी

 

69. Which one of the following is incorrect? निम्नलिखित में से कौन सा गलत है?

 

A. The variables used inside function are called local variables. फंक्शन के अंदर उपयोग किए जाने वाले वेरिएबल लोकल वेरिएबल कहलाते हैं।

B. The local variables of a particular function can be used inside other functions, but these cannot be used in global space. किसी विशेष फंक्शन के लोकल वेरिएबल का उपयोग अन्य फंक्शनी के अंदर किया जा सकता है, लेकिन इनका उपयोग ग्लोबल स्पेस में नहीं किया जा सकता है

 

C. The variables used outside function are called global variables. बाहरी फंक्शन का उपयोग करने वाले वेरिएबल को ग्लोबल वेरिएबल कहा जाता है

D. In order to change the value of global variable inside function, keyword global is used. फंक्शन के अंदर ग्लोबल वेरिएबल की वैल्यू को बदलने के लिए, कीवर्ड ग्लोबल का उपयोग किया जाता है।

 

70. What is the pickling? पिकलिंग क्या है?

 

A. It is used for object serialization इसका उपयोग ऑब्जेक्ट सीरिअलाइजेशन के लिए किया जाता है

B. It is used for object deserialization इसका उपयोग ऑब्जेक्ट डीसीरिअलाइजेशन के लिए किया जाता है

C. All of the mentioned उल्लिखित सभी

D. None of the mentioned उल्लिखित कोई नहीं. 

     

71. How are variable length arguments 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 दो अंडरस्कोर के बाद एक वैलिय आइडेंटिफायर

 

72. Which of the following is valid Python identifiers? निम्नलिखित में से कौन वैध पायथन आइडेंटिफायर नहीं है?

 

A. 10Marks

B. e@mail

C. If

D. my_ python

 

۵ 73. Suppose d = ["john":40, "peter":45). Το obtain the number of entries in dictionary which command do we use? मान लीजिए d = ("John":40, "peter":45] डिक्शनरी में प्रविष्टियों की संख्या प्राप्त करने के लिए हम किस कमांड का उपयोग करते हैं?

 

A. d.size()

B. len(d)

C. size(d)

D. d.len()

 

74. Which of the following returns an array of ones with the same shape and type as a given array? निम्नलिखित में से कौन दिए गए ऐरे के समान आकार और प्रकार का एक ऐरे देता हैं?

 

A. all_like

B. ones _like

C. one _alike

D. all of the mentioned उल्लिखित सभी

 

75. Which of the following attribute should be used while checking for type combination Input and output? निम्न संयोजन में से किस प्रकार का उपयोग इनपुट संयोजन और आउटपुट के लिए आँच करते समय किया जाना चाहिए?

 

A.  .types

B.  .type

C.  .class

D. All of the mentioned उल्लिखित सभी

 

76. What will be the output of the following Python code?निम्नलिखित पायथन कोड का आउटपुट क्या होगा? for i in range(10): if i = 5: break else: print(i) else: print("Here")

 

A. 01234 Here

 

B. 012345 Here

C. 01234

D. 12345

 

77. What will be the output of the following Python expression? निम्नलिखित पायथन एक्सप्रेशन का आउटपुट होगा।

 

- print(4.00/(2.0+2.0))

 

A. 1

B. Error

C. 1.00

D. 1.0

 

78. The correctness and appropriateness of ......solution can be checked very easily. ........की शुद्धता और उपयुक्तता की बहुत आसानी से जांच की जा सकती है।

 

A. algorithmic - एल्गोरिथिमक

B. heuristic हेरिस्टिक

C. random यादृच्छिक

D. none of these - इनमे से कोई नह

 

79. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

x= (i for i in range(3))

for i in x:

print(i)

for i in x:

 

print(i)

 

A.      . 012

B.       Error

        C. 012012

        D. None of the mentioned उल्लिखित कोई नहीं

 

 

80. Modules are files saved with .......extension.       मॉड्यूल.........एक्सटेंशन के साथ सेव की गई फाइलें हैं।

 

A module

B. py

C. both a &b a तथा के दोनों

D. All of the above उपर्युक्त सभी

 

81. If a function doesn't have a return statement, which of the following does the function return? यदि किसी फंक्शन का रिटर्न स्टेटमेंट नहीं है, तो निम्न में से कौन सा पांक्शन रिटर्न होता है?

 

A int-इंट

B. null নল

C. None कोई नहीं

D. An exception is thrown without the return statement रिटर्न स्टेटमेंट के बिना अपवाद को थो कर दिया जाता है

 

82. What is the value of the following expression? निम्नलिखित एक्सप्रेशन की वैल्यू क्या है?

 

>>>float(22//3+3/3)

 

A. 8.0

 

B. 8

C. 8.3

D. None of the above. इनमें से कोई भी नहीं A

 

83. Which of the following functions does not necessarily accept only iterables as arguments? निम्नलिखित में से कौन सा फंक्शन केवल पुनरावृत्तियों को आर्गमेन्ट के रूप में स्वीकार नहीं करता है?

 

A enumerate()

B. all()

C. chr

D. max

 

84. Which module in the python standard library parses options received from the command line? पायथन स्टैंडर्ड लाइब्रेरी में कौन सा मॉड्यूल कमांड लाइन से प्राप्त विकल्पों को पार्स करता है?

 

A. getopt

B. getarg

C. os

D. main

 

85. Which can contain multiple lines of text. जिसमें टेक्स्ट की कई पंक्तियाँ हो सकती है।

 

A. Doestring - डॉकस्टिंग

B. Python Package Index पायथन पैकेज इंडेक्स

C. both a & b a तथा b दोनों

D. none of the mentioned उल्लिखित कोई नहीं

 

86. What is a recursive function? एक रिकर्सिव फंक्शन क्या है?

 

A. A function that calls other function. फंक्शन जो दूसरे फंक्शन को कॉल करता है।

B. A function which calls itself. एक फंक्शन जो स्वयं को कॉल करता है

C. Both A and B A तथा B दोनों

D. None of the above उपर्युक्त में से कोई नहीं

 

87. What will be the output of the following Python code?निम्नलिखित पायथन कोड का आउटपुट होगा।

 

def test (i,j): if(i==0):

return j

else:

return test (i-1,i+j) print (test (4,7))

 

A. 13

B. 7

C. infinite loop

D. 17

 

88. Which mode create new file if the file does not exist?यदि फाइल मौजूद नहीं है तो कौन सा मोड नई फाइल बनाता है?

 

A. write mode राईट मोड

B. append mode अपेन्ड मोड

C. Both of the above उपर्युक्त दोनों

D. None of the above उपर्युक्त में कोई नहीं

 

 

89. Fill in the line of the following Python code for calculating the factorial of a number.किसी संख्या के फैक्टोरियल की गणना के लिए निम्नलिखित पायथन कोड की लाइन भरें।

 

def fact (num): if num == 0: return 1 else: return _____

 

A. num*fact(num-1)

B. (num-1)*(num-2)

C. num*(num-1)

D. fact(num)*fact(num-1)

 

90. What will be the output of the following Python code?निम्नलिखित  पायथन कोड का आउटपुट क्या होगा?

 

for i in range(2.0):

print(i)

 

A. 0.0 1.0

B. 01

C. TypeError: 'float' object can not be interpreted as an integer.

D. none of the mentioned. उल्लिखित कोई नहीं

 

91. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

import math print(abs(math.sqrt(36)))

 

A. Error

B. -6

C. 6

D. 6.0

 

92. Which is the correct operator for power(xy)?पॉवर के लिए सही ऑपरेटर कौन-सा है?

 

A. x^y

B. x**y

C. x^^y

D. None of these इनमें से कोई नही

 

93. What will be the output of the following Python code?निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

def foo(i, x=[]):

x.append(i)

return x

for i in range(3):

print(foo(i))

 

A. [0][0,1][0,1,2]

Β. [0][1][2]

C. [1][2][3]

D. [1][1,2][1,2,3]

 

94. What will be the output of the following Python expression? निम्नलिखित पायथन एक्सप्रेशन का आउटपुट क्या होगा?

 

>>>int(1011)

 

A. 14

B. 11

 

C. 1011

D. None - कोई नहीं

 

95. Which statement will return one line from a file (file object is 'f')? कौन सा स्टेटमेन्ट फाइल से एक लाइन रिटर्न करेगा (फाइल ऑब्जेक्ट ' है)?

 

A. f.readline()

B. f.readlines()

C. f.read()

D. f.line()

 

 

96. Which of the following creates a pattern object? निम्न में से कौन एक पैटर्न ऑब्जेक्ट बनाता है?

 

A. re.create(str)

B. re.regex(str)

C. re.compile(str)

D. re.assemble(str)

 

97. Which module in Python supports regular expressions?पायथन में कौन सा मॉड्यूल रेगुलर एक्सप्रेशन का समर्थन करता है?

 

A. re

B. regex

C. pyregex

D. none of the mentioned उल्लिखित कोई नहीं

 

 

98. This imports * statement import all names in the modules except those beginning with यह imports * स्टेटमेन्ट मॉड्यूल में सभी नामों को इंपोर्ट करता है जो....... से शुरुआत करते हैं।

 

A. _

B. &

C. %

D. None of the above उपरोक्त में से कोई नहीं

 

99. Which of the following options can be used to read the first line of a text file data.txt? टेक्स्ट फाइल data.txt की पहली लाइन को पढ़ने के लिए निम्न में से कौन सा विकल्प इस्तेमाल किया जा सकता है?

 

A. f = open('data.txt'); f.read()

B. f= open('data.txt','r'); f.read(n)

C. myfile = open('data.txt'); f.readline()

D. f = open('data.txt'); f.readlines()

 

100. What will be the output of the following Python code? निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

 

l1=[1, 2, 3, [4]]

l2=list(l1) print(id(l1)==id(12))

 

A. True

B. Error

B. False

D. Address of l


Post a Comment

0 Comments

 python most imp  mcqs set 5