page-banner
Python M3-R5.1 MCQs SET-2
Q1.
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

What will be the output of the following Python code?

from math import factorial
print(math.factorial(5))
A. 120
B. Nothing is printed
C. Error, method factorial doesn't exist in math module
D. Error, the statement should be print(factorial(5))
View Answer
Q2.
जब हम फाइल को एपेंड मोड में खोलते हैं तो फाइल पॉइंटर फाइल के __________ पर होता है।

When we open a file in append mode, the file pointer is at the __________ of the file.
A. फाइल में कहीं भी / Anywhere in between the file
B. अंत / End
C. शुरुआत / Beginning
D. फाइल की दूसरी पंक्ति / Second line of the file
View Answer
Q3.
पैकेज से सभी मॉड्यूल इम्पोर्ट करने के लिए कौन सा कथन सही है?

Which statement is correct to import all modules from the package?
A. from package import all
B. from package import *
C. from package include all
D. from package include *
View Answer
Q4.
निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?

What will be the output of the following code snippet?

numbers = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_numbers = sorted(numbers)
odd_numbers = [x for x in sorted_numbers if x % 2 != 0]
print(odd_numbers)
A. [7, 19, 45, 89]
B. [2, 4, 22, 72]
C. [4, 7, 19, 2, 89, 45, 72, 22]
D. [2, 4, 7, 19, 22, 45, 72, 89]
View Answer
Q5.
निम्नलिखित स्यूडो कोड का आउटपुट क्या होगा, जहाँ AND ऑपरेशन का प्रतिनिधित्व & करता है?

What will be the output of the following pseudo code, where & represents the AND operation?

Integer a, b, c
Set b = 5, a = 1
c = a & b
Print c
A. 1
B. 3
C. 5
D. 7
View Answer
Q6.
fun1() का सही फंक्शन डिक्लेरेशन चुनें ताकि हम निम्नलिखित दो फंक्शन कॉल्स को सफलतापूर्वक निष्पादित कर सकें।

Choose the correct function declaration of fun1() so that we can execute the following two function calls successfully.

fun1(25, 75, 55)
fun1(10, 20)
A. def fun1(**kwargs)
B. def fun1(*args)
C. No, it is not possible in Python
D. def fun1(*data)
View Answer
Q7.
असेम्बली भाषा को मशीनी भाषा में बदलने के लिए किस अनुवादक का प्रयोग किया जाता है?

Which translator is used to convert assembly language into machine language?
A. कंपाइलर / Compiler
B. इंटरप्रेटर / Interpreter
C. असेम्बलर / Assembler
D. इनमें से कोई नहीं / None of these
View Answer
Q8.
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

What will be the output of the following Python code?

x = 'abcd'
for i in x:
    print(i.upper())
A. a BCD
B. Error
C. a b c d
D. ABCD
View Answer
Q9.
निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?

What will be the output of the following code snippet?

from math import *
a = 2.19
b = 3.999999
c = -3.30
print(int(a), floor(b), ceil(c), fabs(c))
A. 23 -3 3.3
B. 23 -3 3
C. 34 -3 3
D. 2 3 -3 3.3
View Answer
Q10.
अन्य मॉड्यूल में किसी मॉड्यूल का उपयोग करने के लिए आपको उस ______ स्टेटमेंट का उपयोग करके इम्पोर्ट करना होगा।

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 the above
View Answer
Q11.
निम्नलिखित अभिव्यक्ति का आउटपुट क्या होगा?

What will be the output of the following expression?

x = 14
print(x >> 2)
A. 14
B. 1
C. 3
D. 2
View Answer
Q12.
निम्नलिखित में से कौन सा फंक्शन पाइथन में बिल्ट-इन फंक्शन है?

Which of the following functions is a built-in function in Python?
A. factorial()
B. seed()
C. print()
D. sqrt()
View Answer
Q13.
निम्नलिखित में से कौन सी डिक्लेरेशन गलत है?

Which of the following declarations is incorrect?
A. x = 2
B. x = 3
C. __xyz__ = 5
D. none of these
View Answer
Q14.
___________फ़ंक्शन फ़ाइल पॉइंटर की वर्तमान स्थिति लौटाता है।

___________function returns the current position of the file pointer.
A. get()
B. seek()
C. tell()
D. cur()
View Answer
Q15.
निम्नलिखित में से कौन सा मॉड्यूल का उपयोग करने का लाभ नहीं है?

Which of the following is not an advantage of using modules?
A. Provides a means of reuse of program code
B. Provides a means of dividing up tasks
C. Provides a means of reducing the size of the program
D. Provides a means of testing individual parts of the program
View Answer
Q16.
x का डेटा टाइप क्या है?

What is the datatype of x?

import numpy as np
a = np.array([1, 2, 3, 4])
x = a.tolist()
A. int
B. tuple
C. array
D. list
View Answer
Q17.
किस सॉफ्टवेयर विकास चरण में सॉफ्टवेयर की गुणवत्ता का दस्तावेजीकरण किया जाता है?

In which software development phase is the quality of software documented?
A. Testing
B. Idea
C. Delivery
D. Development
View Answer
Q18.
निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?

What will be the output of the following code snippet?

d = {3, 4, 5}
for k in d:
    print(k)
A. {3,4,5} {3,4,5} {3,4,5}
B. 3 4 5
C. Syntax Error
D. None of the above
View Answer
Q19.
फ्लो चार्ट में दो ब्लॉक को जोड़ने के लिए फ्लोलाइन के रूप में किस चिन्ह का उपयोग किया जाता है?

Which symbol is used as a flowline to connect two blocks in a flowchart?
A. arrow
B. box
C. circle
D. parallelogram
View Answer
Q20.
कौन सा कथन फ़ाइल पॉइंटर को वर्तमान स्थिति से 10 बाइट पीछे ले जायेगा?

Which statement will move the file pointer 10 bytes backward from the current position?
A. f.seek-10, 0)
B. f.seek(10, 0)
C. f.seek(-10, 1)
D. none of the above
View Answer
Q21.
निम्नलिखित कोड स्निपेट का आउटपुट क्या है?

What is the output of the following code snippet?

print([i.lower() for i in "HELLO"])
A. hello
B. hel
C. ['h', 'e', 'l', 'l', 'o']
D. HELLO
View Answer
Q22.
निम्नलिखित का आउटपुट क्या होगा?

What will be the output of the following?

Y = [2, 5J, 6]
Y.sort()
A. [2,6,5J]
B. [5J,2,6]
C. Error
D. [6,5J,2]
View Answer
Q23.
निम्नलिखित कोड का परिणाम क्या है?

What is the output of the following code?

import numpy as np
a = np.array([1,2,3,5,8])
b = np.array([0,3,4,2,1])
c = a + b
c = c * a
print(c[2])
A. 10
B. 21
C. 12
D. 28
View Answer
Q24.
एक ___________ स्टेटमेंट का उपयोग तब किया जाता है जब किसी स्टेटमेंट की वाक्यात्मक रूप से आवश्यकता होती है लेकिन आप नहीं चाहते कि कोई कोड निष्पादित हो।

___________statement is used when a statement is required syntactically but you do not want any code to execute.
A. break
B. pass
C. continue
D. none of these
View Answer
Q25.
दिए गए कोड द्वारा निम्न में से कौन सी त्रुटि लौटाई जाती है?

Which of the following error is returned by the given code?

f = open("test.txt" , "w")
>>> f.write(345)
A. Syntax Error
B. Type Error
C. String Error
D. Run Time Error
View Answer