Subscribe Us

Responsive Advertisement

Advertisement

m3 r5 python mcqs set 2

 


m3 r5 python mcqs set 2 ,python mcqs hindi








1. What is the output of the code print(7%2). कोड print (7%2) का आउटपुट क्या है।

 

A. 5.5

B. 3.5

C. 1

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

 

 

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

 a={1:"A",2:"B", 3: "C"}

for i in a:

     print(i,end="")

 

A. 1'A' 2 'B' 3 'C'

B. 'A' 'B' 'C'

C. 123

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

 

3. Python allows string slicing. What is the output of below code: पायथन स्ट्रिंग स्लाइसिंग की अनुमति देता है। नीचे दिए गए कोड का आउटपुट क्या है:

 

s='cppbuzz chicago'

 print(s[3:5])

 

A. pbuzz

 

B. bu

C. bu ()

D. None कोई नहीं

 

4. Which of the following is the use of function in python? निम्नलिखित में से कौन सा पायथन में फंक्शन का उपयोग है?

 

A. Functions are reusable pieces of programs फंक्शंस प्रोग्रामों के पुनः प्रयोज्य टुकड़े हैं।

B. Functions don't provide better modularity for your application फक्शन्स आपके एप्लिकेशन के लिए बेहतर मॉड्यूलरता प्रदान नहीं करते हैं।

C. you can't also create your own functions आप अपना स्वयं का फंक्शन नहीं बना सकते

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

 

 

5. Which of the following are valid string manipulation functions in Python?निम्नलिखित में से कौन सा पायथन में मान्य स्ट्रिंग मैनीपुलेशन फंक्शन हैं?

 

A. count()

B. upper()

C. strip()

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

 

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

 

for i in 'abcd' [::-1]:

     print (i)

 

A. abcd

B. dcba

C. Error

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

 

7. Which of the following mode will refer to binary data?निम्न में से कौन सा मोड बाइनरी डेटा को संदर्भित करेगा?

 

A. r

B. W

C+

D. b

 

 8. Which of these definitions correctly describes a module? इनमें से कौन सी परिभाषा सही ढंग से एक मॉड्यूल का वर्णन करती है?

 

A. Denoted by triple quotes for providing the specification of certain program elements कुछ प्रोग्राम एलीमेंटों के विनिर्देश प्रदान करने के लिए ट्रिपल कोट्स द्वारा अस्वीकृत

B. Design and implementation of specific functionality to be incorporated into a program एक प्रोग्राम में शामिल किए जाने के लिए विशिष्ट कार्यक्षमता का डिजाइन और कार्यान्वयन

C. Defines the specification of how it is to be used इसका उपयोग कैसे करना है, इसके विनिर्देश को परिभाषित करता है

D. Any program that reuses code कोई भी प्रोग्राम जो कोड का पुनः उपयोग करता है

 

9. Which of the following is not a part of Execution Flow during debugging? निम्न में से कौन सा डीबगिंग के दौरान एक्सिक्यूशन फ्लो का हिस्सा नहीं है?

 

A. Step Up स्टेप अप

B. Step Over स्टेप ओवर

C. Step out स्टेप आउट

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

 

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

 

import numpy as np

 ary= np.array([1,2,3,5,8])

 ary ary+1

 print (ary[1])      

                                 

 A. 3

B. 2

C. 5

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

 

11....... is a string literal denoted by triple quotes for providing the specifications of certain program elements.......एक स्ट्रिंग अक्षर है जिसे कुछ प्रोग्राम एलिमेन्टो के स्पेशिफिकेशन को प्रोवाइड करने के लिए ट्रिपल कोट्स द्वारा दर्शाया जाता है।

 

A. Interface इंटरफेस

 

B. Modularity मॉड्यूलेरिटी

C. Client क्लाइंट

D. Docstring-डॉकस्ट्रिंग

 

12. Which of the following isn't true about main modules? मुख्य मॉड्यूल के बारे में निम्नलिखित में से कौन सा सही नहीं है?

 

A. When a python file is directly executed, it is considered main module of a program. जब एक पायथन फाइल को सीधे निष्पादित किया जाता है, तो इसे प्रोग्राम का मुख्य मॉड्यूल माना जाता है

B. Main modules may import any number of modules. मुख्य मॉड्यूल किसी भी संख्या में मॉड्यूल आयात कर सकते हैं

C. Special name given to main modules is:_main_मुख्य मॉड्यूल को दिया गया विशेष नाम है:_main_

D. Other main modules can import main modules. अन्य मुख्य मॉड्यूल मुख्य मॉड्यूल आयात कर सकते हैं

 

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

 

from math import factorial

 print(factorial(5))

 

A. 120

B. Nothing is printed. कुछ भी प्रिंट नहीं हुआ है

C. Error, method factorial doesn't exist in math module; एरर मैथ मॉड्यूल में फैक्टोरियल मेथड मौजूद नहीं है

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

 

 

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

 

string = "my name is x"

 for i in string:

    print (i, end-",  ")

 

A. m. y,, n, a, m, e, i,s,, x,

B. my,, n, a, m, e, i, s,, x

C. my, name, is, x,

D. Error

 

15. How is a function declared in Python पायथन में फंक्शन कैसे डिक्लेयर किया जाता है?

 

A. def function function_name():

B. declare function function_name():

C. def function_name():

D. declare function_name():

 

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

 

def check(a):

 print("Even" if a % 2==0 else  "Odd")

check (7)

 

A. Even

B. Odd

C. Error

D. None

 

17. What error is returned by the following statement if the file does not exist? यदि फाइल मौजूद नहीं है, तो निम्न स्टेटमेन्ट द्वारा कौन सी एरर रिटर्न होती है?

 

f=open("A.txt")

 

A. FileNotFoundError

B. NotFoundError

C. FileNotFound

D. FoundError

 

18. Which of the following is False regarding loops in Python? निम्नलिखित में से कौन सा पायथन में लूप के संबंध में गलत है?

 

A. Loops are used to perform certain tasks repeatedly. कुछ कार्यों को बार-बार करने के लिए लूप्स का उपयोग किया जाता है।

B. While loop is used when multiple statements are to executed repeatedly until the given condition becomes False. व्हाइल लूप का उपयोग तब किया जाता है अनेक स्टेटमेन्टो को बार-बार निष्पादित किया जाता है जब तक कि दी गई कंडीशन फॉल्स हो जाए

C. While loop is used when multiple statements are to executed repeatedly until the given condition becomes True. व्हाइल लूप का उपयोग तब किया जाता है जा अनेक स्टेटमेंट को बार-बार निष्पादित किया जाता है जब तक कि दी गई कंडीशन टू नहीं हो जाती।

D. for loop can be used to iterate through the elements of lists. फॉर लूप लिस्टो के एलिमेन्टो के माध्यम से इटरेट करने के लिए इस्तेमाल किया जा सकता है।

 

19. Find the output of the following python code ...निम्नलिखित पॉयथन कोड के आउटपुट का पता लगाएं:

 

i= 0

 sum

while i < 9:

  if i % 4==0:

   Sum =sum+i

  i=i+2

print(sum)

 

A. Infinite Loop

B. 12

C. 14

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

 

20. Choose the correct option with respect to Python. पायथन के संबंध में सही विकल्प चुनें।

 

A. Both tuples and lists are immutable. दुपल्स और सूचियां दोनों अपरिवर्तनीय है।

B. Tuples are immutable while lists are mutable दुपल्स अपरिवर्तनीय है जबकि सूचिया परिवर्तनीय है।

C.Both tuples and lists are mutable. दुपल्स और सूचियाँ दोनों परिवर्तनशील है।

D. Tuples are mutable while lists are immutable. दुपल्स परिवर्तनशील होते हैं जबकि सूचियों अपरिवर्तनीय होती है।

 

21. Which of the following statement is False? निम्नलिखित में से कौन सा कथन असत्य है?

 

A String is immutable. स्ट्रिम अपरिवर्तनीय है।

B. capitalize() function in string is used to return a string by converting the whole given string into uppercase. स्ट्रिंग में capitalize() फंक्शन को उपयोग पूरे दिए गए स्ट्रिंग को अपरकेस ने परिवर्तित करके एक स्ट्रिंग को वापस करने के लिए किया जाता है।

C. lower() function in string is used to return a string by converting the whole given string into lowercase. स्ट्रिंग में lower() फंक्शन की उपयोग पूरे दिए गए स्ट्रिंग को लोअरकेस में परिवर्तित करके एक स्ट्रिंग को वापस करने के लिए किया जाता है।

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

 

22. The for loop in Python is an......पॉयथन में फॉर लूप...... है।

 

A Entry Controlled Loop इंट्री कंट्रोल्ड लूप

B. Exit Controlled Loop एक्जिट कंट्रोल्ड लूप

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

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

 

23. You can also create your own functions, these functions are called? आप अपने खुद के फंक्शन मी बना सकते हैं, इन फंक्शन्स को क्या कहते हैं?

 

A. built-in functions

B. user-defined functions

C. py function

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

 

24. Choose the correct option with respect to Python........पायथन के संबंध में सही विकल्प चुनें।

 

A. In Python, a tuple can contain only integers as its elements, पायथन में एक टपल में इसके एलीमेंट के रूप में कंबल इंटीजर हो सकते हैं।

B. In Python, a tuple can contain only strings as its elements. पायथन में एक टपल में इसके एलीमेंट के रूप में केवल स्ट्रीम हो सकते हैं।

C. In Python, a tuple can contain both integers and strings as its elements. पाययन में एक टपल में इसके एलीमेंट के रूप में इंटीजर और स्ट्रिंग दोनों हो सकते हैं।

D. In Python, a tuple can contain either string or integer but not both at a time. पायथन में एक टपल में या तो स्ट्रिंग हो सकते है, या तो इंटीजर लेकिन एक समय में दोनों नहीं हो सकते हैं।

 

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

 

dict1={'first': 'sunday','second' : 'monday'}

 dict2= {1: 3,2:4

 dict1.update(dict2)

print (dict1) 

 

 A. {'first': 'sunday', 'second': 'monday', 1:3,2:4}.                                                                        

 B. {'first': 'sunday', 'second': 'monday'}         

C. {1:3,2:4}

D. None of these

 

26. What will be the output of below Python code? निम्नलिखित में से कौन सा एक वैध पायथन यदि कथन है:

 

str1="Aplication"

str2=str1.replace('a', 'A')

print (str2)

 

A. Application

B. AplicAtion

C. Application

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

 

27. Can we write if/else into one line in python? क्या हम पाइथन में एक लाइन में if/else लिख सकते हैं?

 

A. Yes

B. No

C. if/else not used in python

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

 

28. A loop block in python starts with a.. - पायथन में एक लूप ब्लॉक एक... से शुरू होता है

 

A. ; (semicolon)

B. ,(Comma)

C. : (colan)

D. None of these - कोई नहीं

 

 

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

 

s = 1, 2, 3, 3, 2, 4, 5, 5)

print(s)

 

Α. (1,2,3,3,2,4,5,5)

B. (1,2,3,4,5)

C. None

D. (1,5)

 

30. What keyword would you use to add an alternative condition to an if statement? If स्टेटमेंट में वैकल्पिक कंडीशन जोड़ने के लिए आप किस कीवर्ड का उपयोग करेंगे?

 

A. else if

B. elseif

C. elif

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

 

31. Which of the following creates a tuple? निम्न में से कौन टपल बनाता है?

 

A. tuple1=("a","b")

B. tuple1[2]=("a","b")

C. tuple1=(5)*2

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

 

 

32. Which of the following is not a valid keyword of Python associated with loops?निम्नलिखित में से कौन लूप से सम्बन्धित पायथन का वैलिड कीवर्ड नहीं है?

 

A. continue - कांटिन्यू

B. check - चेक

C. range - रेंज

D. break - ब्रेक

 

33. Does python have switch case statement? क्या पायथन में स्विच केस स्टेटमेंट होता है?

 

A. True

B. False

C. Python has switch statement but we can not use it.

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

 

 

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

 

print((1, 2) + (3,4))

 

A. (1,2,3,4)

B. 10

C. (2, 3, 4,1)

 

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

 

35........in Python is a counter-controlled loop. पायथन में काउन्टर कन्ट्रोल्ड लूप है।

 

A. for

B. do while

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

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

 

36. What is the output of the following code. निम्नलिखित कोड का आउटपुट क्या है।

 

str = "Welcome"

str[2] = 'a'

print(str)

 

A. Weacome

B. Error

C. aWelcome

D. Welcomea

 

 

37. If the else statement is used with a while loop, the else statement is executed when the condition becomes….. यदि else स्टेटमेंट का प्रयोग 'व्हाइल' लूप के साथ किया जाता है, तो else स्टेटमेंट तब निष्पादित होता है जब कंडीशन….. हो जाती है।

 

A. True

B. False

C. Infinite

D. NULL

 

38. readlines() method return........ रीडलाइन्स मेथड .... को रिटर्न करता है।

 

A. String

B. List

C. Dictionary

D. Tuple

 

39. Which statement will open file "data.txt" in append mode? कौन सा स्टेटमेंट एपेंड मोड में फाइल "data.txt" को खोलेगा? मेथड रिटर्न करता

 

A. fopen("data.txt", "a")

B. f= Open("data.txt", "ab")

C. f=new("data.txt", "a")

D. open("data.txt", "a")

 

 

40. Which term describes a loop that continues repeating without a terminating (ending) condition? कौन सा शब्द एक लूप का वर्णन करता है जो बिना किसी समाप्ति (समाप्त) स्थिति के दोहराना जारी रखता है?

 

A. Infinite Loop इन्फाईनाइट लूप

 

B. conditional loop कंडीशनल लूप

C. unlimited loop अनलिमीटेड लूप

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

 

41. Which of the following option will give "Simon" as output?निम्न में से कौन सा विकल्प आउटपुट के रूप में 'साइमन' देगा?

 

str1="John, Simon, Aryan"

 

A. print(str1[-7:-12])

B. print(str1[-11:-7])

C. print(str1[-11:-6])

D. print(str1[-7:-11])

 

42. To access a list which contains ten elements, which of the following uses of range would produce a list of the desired indexes? एक सूची को एक्सेस करना जिसमें दस एलिमेन्ट होते हैं, निम्नलिखित में से कौन सा उपयोग रेंज (0 वांछित इन्डेक्स की सूची तैयार करेगा?

 

A. range(1,10)

B. range(0,9)

C. range(10)

D. range(1,11)

 

 

43. Find the output of the following program segments: निम्नलिखित प्रोग्राम सेगमेंट के आउटपुट का पता लगाएं:

 

country 'INDIA'

 for i in country:

print (i, end=' ')|

 

A. INDIA

B. I N D I A

C. INDI

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

 

44. What is another word for iteration? पुनरावृत्ति का दूसरा नाम क्या है?

 

A. Selection

B. Assignment

C. Sequencing

D. Repetition

 

45. Can tuple be used as dictionary key in python? क्या टपल को पायथन में डिक्शनरी कुंजी के रूप में इस्तेमाल किया जा सकता है?

 

A. True

B. False

C. Tuple is not used in python

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

 

46. which of the following is consider as an infinite loop? निम्न में से किसे इनफाईनाइट लूप माना जाता है?

 

A. while(infinite):

B. while(1):

C. while(not 1):

D. while(11)

 

47. Which of the following is incorrect regarding variables in Python? पायथन में वेरिएबल्स के संबंध में निम्नलिखित में से कौन सा गलत है?

 

A. Variable names in Python cannot start with number. However, it can contain number in any other position of variable name. Python में वेरिएबल नेम नंबर से शुरू नहीं हो सकते हैं। हालाँकि, इसमें वेरिएबल नेम की किसी अन्य स्थिति में संख्या हो सकती है।

B. Variable names can start with an underscore. वेरिएबल नेम अंडरस्कोर से शुरू हो सकते हैं।

C. Data type of variable names should not be declared. डेटा प्रकार के वेरिएबल नेम डिक्लेयर नहीं किए जाने चाहिए।

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

 

 

48. Which of the following will give error? निम्नलिखित में से कौन त्रुटि देगा?

 

A. a=b=c=1

B. a,b,c=1

C. a,b,c=1, "python", 1.5

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

 

 

49. How many keywords are there in python 3.7? पायथन 3.7 में कितने कीवर्ड होते है?

 

A. 32

B. 33

C. 31

D. 30

 

50. In a Python program, a control structure: एक पायथन प्रोग्राम में, एक कंट्रोल स्ट्रक्चर

 

A. Defines  program-specific data structures . प्रोग्राम-विशिष्ट डेटा स्ट्रक्चरों को डिफाइन करता है।

B. Directs the order of execution of the statements in the program. प्रोग्राम में स्टेटमेन्टो के निष्पादन के आर्डर की निर्देशित करता है।

C. Dictates what happens before the program starts and after it terminates. प्रोग्राम शुरू होने से पहले और उसके समाप्त होने के बाद क्या होता है, यह बताता है।

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

 

51. Which of the following function returns the ASCII/Unicode value character?निम्नलिखित में से कौन सा फंक्शन ASCII/Unicode वैल्यू कैरेक्टर रिटर्न करता है?

 

A. asc

B. ord()

C. asci()

D. ascii()

 

52. Which of the following is a mapping datatype? निम्न में से कौन एक मैपिंग डेटाटाइप है?

 

A. String - स्ट्रिंग

B. List - लिस्ट

C. Tuple - टपल

D. Dictionary - डिक्शनरी

 

53. What type of Error is returned by statement? निम्नलिखित स्टेटमेन्ट द्वारा किस प्रकार की त्रुटि रिटर्न की जाती है?

 

>>>str[1.5]

 

A. SyntaxError

B. valueError

C. TypeError

D. IndexError

 

54. Which of these are keyword? इनमें से कौन से कीवर्ड हैं?

 

A. in

B. is

C. assert

D. All सभी

 

55. Write the output of the following code: निम्नलिखित कोड का आउटपुट क्या है।

>>>print("Amita">"amit")

>>>print("Amita"<"amit")

 

A. True False

B. False True

C. Error

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

 

56. Each individual character in a string can be accessed  using a technique called ........एक स्ट्रिंग में प्रत्येक इनडिविजुअल कैरेक्टर को ......नामक तकनीक का उपयोग करके एक्सेस किया जा सकता है

 

A. indexing - इन्डेक्सिंग

B. Replication - रेप्लिकेशन

C. concatenation कॉन्केटनेशन

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

 

57. Write the output of the following code: निम्नलिखित कोड का आउटपुट क्या है? s="OLEVEL" for i in range(-1,-len(s),-1): print(s[i],end="$")

 

A. L$E$V$E$L$O$

B. L$E$V$E$L$

C. Error

D. None कोई नहीं

 

58. Python allows .......operations on string data type. पायथन स्ट्रिंग डेटा प्रकार पर .......ऑपरेशन की अनुमति देता है। 

 

A. Concatenation - कॉनकैटनेशन

B. Membership - मेंबरशिप

C. Slicing - स्लाईसिंग

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

 

59. Which of the following is correct slicing operation to extract every kth character from the string str1 starting from n and ending at m-1. स्ट्रिंग str1 से n से शुरू होकर m-1 पर समाप्त होने वाले प्रत्येक kth कैरेक्टर को निकालने के लिए निम्नलिखित में से कौन सा सही स्लाइसिंग ऑपरेशन

है।

 

A. a. str1[:: k]

B. str1[n : m+1 : k]

C. str1[n:m:k]

D. str1[m:n:k]

 

60. str[:] will return...... str[:] रिटर्न करेगा।

 

A. empty

B. complete string

C. Partial string

D. Error

 

61. Write the output of the following code: निम्नलिखित कोड का आउटपुट क्या है?

 

for i in range(65,70):

    print(chr(i))

 

A. Error

B. TypeError

C. ABCDE

D. 65666770

 

52. Which method is used to access some part of a string or substring. स्ट्रिंग या सबस्ट्रिंग के कुछ भाग को एक्सेस करने के लिए किस विधि का उपयोग किया जाता है।

 

A. slicer स्लाईसर

B. Slicing - स्लाईसिंग

C. membership - मेम्बरशिप

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

 

63. Write the output of the following code: निम्नलिखित कोड का आउटपुट लिखिएः

 

>>>       str1      =        'HelloWorld!!'

>>> str1.isalnum()

 

A. False

B. True

C. Error

 

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

 

64. str[11:5] will return...... str[11:5] रिटर्न करेगा।

 

A. empty string

B. complete string

C. string of six characters

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

 

65. What does the function re.match do? फंक्शन re-match क्या करता है?

 

A. matches a pattern at the start of the string. स्ट्रिंग की शुरुआत में एक पैटर्न से मेल खाता है

B. matches a pattern at any position in the string. स्ट्रिंग में किसी भी स्थिति में एक पैटर्न से मेल खाता है

C. such a function does not exist ऐसा कोई फंक्शन मौजूद नहीं है

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

 

66. How many times will this loop Run? यह लूप कितनी बार चलेगा ?

 

while(1):

  print(2)

 

A. 1 time

B. 2 time

 

C. 3 time

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

 

67. What will be the final value of I after execution of the loop: लूप के एक्सिक्यूशन के बाद I का अंतिम वैल्यू क्या होगी:

for I in range(10):

  print(I)

 

A. 10

B. 9

C. Error

D. None कोई नहीं

 

68. Write the output of the following code: निम्नलिखित कोड का आउटपुट लिखिएः

 

s="hello 123"

 print(s.islower())

 

A. False

B. True

C. Error

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

 

69. str[5:11] will return......characters. str[5:11] कैरेक्टर रिटर्न करेगा।

 

A. 5

B. 6

C. 11

D. None कोई नही

 

70. What does the function re.search do? फंक्शन re-search क्या करता है?

 

A. matches a pattern at the start of the string. स्ट्रिंग की शुरुआत में एक पैटर्न से मेल खाता है

B. matches a pattern at any position in the string. स्ट्रिंग में किसी भी स्थिति में एक पैटर्न से मेल खाता है

C. such a function does not exist. ऐसा कोई फंक्शन मौजूद नहीं है

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

 

71. When we open file in append mode the file pointer is at the ......of the file. जब हम अपेंड मोड में फाइल खोलते हैं तो फाइल पॉइंटर फाइल के पर होता है।

 

A. end अंतिम में

B. beginning शुरूआत में

C. anywhere in between the file फाइल में कहीं भी

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

 

72. Which of the following function returns True if the string is non-empty and has all uppercase alphabets. यदि स्ट्रिंग नॉन-इम्पटी है और सभी अपरकेस अक्षर हैं, तो निम्न में से कौन सा फंक्शन सही है।

 

A. islower()

B. isupper()

C. Islower()

D. None कोई नहीं

 

73. Write the output of the following programm: निम्नलिखित प्रोग्राम का आउटपुट लिखिएः

 

 print("Welcome-Python".isalnum())

 print(str("Welcome Python".isalnum()).upper())

 

A. True False

B. False True

C. Yes No

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

 

 

74. Which of the following will return reverse string str1? निम्नलिखित में से कौन रिवर्स स्ट्रिंग str1 रिटर्न करेगा?

 

A. str1[::-1]

B. str1[::1]

C. str1[:-1:-1]

D. None कोई नहीं

 

75. Python programming language allows to use one loop inside another loop known as? पायधन प्रोग्रामिंग भाषा एक लूप को दूसरे लूप के अंदर उपयोग करने की अनुमति देती है जिसे जाना जाता है?

 

A. switch

B. foreach

C. nested

D. None कोई नहीं

 

76. Which function returns the exact copy of the string with the first letter in uppercase. कौन सा फंक्शन अपरकेस में पहले अक्षर के साथ स्ट्रिंग की सटीक प्रतिलिपि देता है।

 

A. find()

B. copy()

C. upper()

D. capitalize()

 

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

 

x="Amazing"

print(x[3:],"and", x[:2])

 

A. Amazing and ZI

B. aZing and Zin

C. Zing and Am

 

D. Azing and zin

 

78. import math                            

       math.floor(3.4)

 

What is the value returned by? द्वारा रिटर्न की गई वैल्यू क्या है?

 

A. 3

B. 4

C. 4.0

D. 3.0

 

79. Which of the following function returns the string with first letter of every word in the string in uppercase and rest in lowercase?निम्नलिखित में से कौन सा फंक्शन स्ट्रिंग में प्रत्येक शब्द के पहले कैरेक्टर को अपरकेस में और बाकी को लोअरकेस में रिटर्न करता है?                                       

  A. capitalize()

B. title()

C. upper()

D. swapcase()

 

80. split() function returns the of words delimited by the specified substring. स्प्लिट() फंक्शन निर्दिष्ट सबस्ट्रिंग द्वारा सीमांकित शब्दों का..... देता है।

 

A. List लिस्ट

B. Tuple टपल

C. Dictionary डिक्शनरी

 

D. None कोई नहीं

 

 81. What will be the output of the following program on execution? एक्सिक्यूशन पर निम्नलिखित प्रोग्राम का आउटपुट क्या होगा?

 

if False:

  print ("inside if block")

elif True:

  print ("inside elif block")

else:

  print ("inside else block")

 

A. inside if block

B. inside elif block

C. inside else block

D. Error

 

 

82. Which of the following statements are correct? निम्नलिखित में से कौन से कथन सही हैं?

 

(1) Python is a high level programming language. पायथन एक उच्च स्तरीय प्रोग्रामिंग भाषा है।

(ii) Python is a compiled language. पायथन एक कम्पाइल्ड लैंग्वेज है।

(iii) Python program is compiled before it is interpreted. पायथन प्रोग्राम को इन्टरप्रिट करने से पहले उसे कम्पाइल किया जाता है।

A. i, ii

 

B. i, iii

C. ii, iii

D.ii, iii

 

83. What will be the result of following Python code snippet after execution?  एक्सिक्यूसन के बाद निम्नलिखित पायथन कोड स्निपेट का परिणाम क्या होगा?

 

str1=" "

i=0  

var2=1  

while(i<3):   

    var1=1        

    if str1:   

        var2=var1*var2+5   

     else:   

        var2-var1*var2+1   

         i=i+1

 print(var2)

 

A. 16

C. 11

B.12

D. 4

 

84. Write the output of the following: निम्नलिखित का आउटपुट लिखेंः

>>> str1 = 'Hello World! Hello Hello'                                            

 >>> str1.count('Hello',12,25)

 

A. 1

B. 2

C. 3

D. 4

 

85. If str1="Programming        Language" What does str1.find("m") return?

 

A. Number of occurances of "m" in string str1.

B. Index positions of "m" in the string str1.

C. It returns the whole string str1 if it contains "m".

D. It returns the index position of first occurance of "m" in the string str1.

 

86. What index value is returned by the following code? निम्नलिखित कोड द्वारा कौन सा इन्डेक्स वैल्यू रिटर्न होता है?

 

s="Hello"

print(s.find('l'))

 

A. 2

B. 3

C. 4

D. -2

 

87. Which of the following is not a relational opeartor in Python? निम्नलिखित में से कौन पायथन में एक रिलेशनल ऑपरेटर नहीं है?

 

A. >=

B. <=

C. =

D. !=

 

88. Suppose a list with name arr, contains 5 elements. You can get the 2nd element from the list using: मान लीजिए कि arr नाम वाली एक सूची में 5 एलिमेन्ट हैं। आप सूची से दूसरा एलिमेन्ट प्राप्त कर सकते हैं:

 

A. arr[-2]

C. arr[-1]

B. arr[2]

D. arr[1]

 

89. The continue statement can be used in? कंटिन्यू स्टेटमेन्ट का उपयोग किया जा सकता है?

 

A. while loop

B. for loop

C. do-while

D. Both A and B

 

90. Write the output of the following: निम्नलिखित का आउटपुट लिखिए :

 

print("python".join("@"))

 

A. 'p@y@t@h@o@n'

B. 'p@y@t@h@o@n@'

C. '@p@y@t@h@o@n@'

D. '@'

 

91. What will be output of this expression: इस एक्सप्रेशन का आउटपुट क्या होगाः

 

'p' + 'q' if '12'.isdigit() else 'r' + 's'

 

A. pq

B. rs

C. pqrs

D. pq12

 

92. If no delimiter is given in split() function then words are separated by..... यदि split() फंक्शन में कोई डेलीमीटर नहीं दिया गया है तो शब्दों को.... द्वारा अलग किया जाता है

 

A. space - स्पेस

B. colon कोलन

C. semi colon सेमी कोलन

D. None कोई नहीं

 

 

93. What is the output of the following code? नीचे दिए गए कोड का आउटपुट क्या होगा?

>>>"Hello".replace("I", "e")

 

A. Heeeo

B. Heelo

C. Heleo

D. None - कोई नहीं       

 

94. Write the output of the following: निम्नलिखित का आउटपुट लिखेंः

 

print("Absbcbcgdbc".count("b",4))

print("Absbcbcgdbc".find("b",5))

 

A. 1

B. 25

C. 3

D. 4

 

95. 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 एक या अधिक

 

96. Suppose listExample is ['h','e',l ',' l ','o'], then what is len (listExample)? मान लीजिए listExample['h','e', ' l ', ' l ','o'] है, तो len (listExample) क्या है?

 

A. 5

B. 4

C. None

D. Error

 

 

97. Each line of a text file is terminated by a special character, called the.....टेक्स्ट फाइल की प्रत्येक पंक्ति को एक विशेष कैरेक्टर द्वारा समाप्त किया जाता है, जिसे .......कहा जाता है।

 

A. End of File फाईल का अंत

B. End of Line लाईन का अंत

C. End of Statement स्टेटमेंट का अंत

D. End of program प्रोग्राम का अंत

 

98. Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation? मान लीजिए लिस्ट 1 (4. 2. 2, 4, 5, 2, 1, 0) है, स्लाईसिंग ऑपरेशन के लिए निम्नलिखित में से कौन-सा सिंटैक्स सही है?

 

A. print(list1 [2:])

B. print(list1[:2])

C. print(list1[:-2])

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

 

99. What is the output of the following code- निम्नलिखित कोड का आउटपुट क्या होगा-

>>>print('ab,12'.isalnum())

 

A. True

B. False

C. None

D. Error

 

100. Which of the following function returns the index value of first occurrence of substring occurring in the given string. निम्नलिखित में से कौन सा फंक्शन दिए गए स्ट्रिंग में होने वाली सबस्ट्रिंग के पहले अकरेन्स की इन्डेक्स वैल्यू देता है।

 

A. index()

B. find

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

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

Post a Comment

0 Comments

 python most imp  mcqs set 5