page-banner
Python M3-R5.1 MCQs SET-11
Q6.
निम्नलिखित कोड द्वारा कितनी संख्याएँ मुद्रित की जाएंगी?<break-line><break-line>How many numbers will be printed by the following code ?<pre><code>def fun(a,b): for x in range(a,b+1): if x%3==0: print(x, end=" ") fun(100,120)</code></pre>
A. 7
B. 8
C. 6
D. 9
View Answer
Q7.
निम्नलिखित कोड क्या प्रिंट करता है?<break-line><break-line>What does the following code print?<pre><code>x = 'mohan' for i in range(len(x)): x[i].upper() print(x)</code></pre>
A. mohan
B. MOHAN
C. Error
D. None of these
View Answer
Q8.
फ़ाइल ऑब्जेक्ट infile से फ़ाइल की शेष पंक्तियों को पढ़ने का कार्य कौन सा है?<break-line><break-line>Which is the function to read the remaining lines of the file from a file object infile ?
A. infile.read
B. infile.read()
C. infile.readlines()
D. infile.readline()
View Answer
Q9.
निम्नलिखित का आउटपुट क्या होगा?<break-line><break-line>What will be the output of the following?<pre><code>import numpy as np a = np.array([1,5,4,7,8]) a = a + 1 print(a[1])</code></pre>
A. 4
B. 5
C. 6
D. 7
View Answer
Q10.
निम्नलिखित कोड का परिणाम क्या है?<break-line><break-line>What is the output of the following code?<pre><code>dict={"Joey":1,"Rachel":2} dict.update({"Phoebe":2}) print(dict)</code></pre>
A. "Joey":1,"Rachel":2,"Phoebe":2
B. {"Joey":1,"Rachel":2}
C. {"Joey":1,"Phoebe":2}
D. Error
View Answer