page-banner
Python M3-R5.1 MCQs SET-2
Q1.
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?<break-line><break-line>What will be the output of the following Python code?<break-line><break-line><pre><code>from math import factorial print(math.factorial(5))</code></pre>
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.
जब हम फाइल को एपेंड मोड में खोलते हैं तो फाइल पॉइंटर फाइल के __________ पर होता है।<break-line><break-line>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.
पैकेज से सभी मॉड्यूल इम्पोर्ट करने के लिए कौन सा कथन सही है?<break-line><break-line>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.
निम्नलिखित कोड स्निपेट का आउटपुट क्या होगा?<break-line><break-line>What will be the output of the following code snippet?<break-line><break-line><pre><code>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)</code></pre>
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 ऑपरेशन का प्रतिनिधित्व & करता है?<break-line><break-line>What will be the output of the following pseudo code, where & represents the AND operation?<break-line><break-line><pre><code>Integer a, b, c Set b = 5, a = 1 c = a & b Print c</code></pre>
A. 1
B. 3
C. 5
D. 7
View Answer