page-banner
Python M3-R5.1 MCQs SET-11
Q6.
निम्नलिखित कोड द्वारा कितनी संख्याएँ मुद्रित की जाएंगी?

How many numbers will be printed by the following code ?
def fun(a,b):
    for x in range(a,b+1):
        if x%3==0:
            print(x, end=" ")
fun(100,120)
A. 7
B. 8
C. 6
D. 9
View Answer
Q7.
निम्नलिखित कोड क्या प्रिंट करता है?

What does the following code print?
x = 'mohan'
for i in range(len(x)):
    x[i].upper()
print(x)
A. mohan
B. MOHAN
C. Error
D. None of these
View Answer
Q8.
फ़ाइल ऑब्जेक्ट infile से फ़ाइल की शेष पंक्तियों को पढ़ने का कार्य कौन सा है?

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.
निम्नलिखित का आउटपुट क्या होगा?

What will be the output of the following?
import numpy as np
a = np.array([1,5,4,7,8])
a = a + 1
print(a[1])
A. 4
B. 5
C. 6
D. 7
View Answer
Q10.
निम्नलिखित कोड का परिणाम क्या है?

What is the output of the following code?
dict={"Joey":1,"Rachel":2}
dict.update({"Phoebe":2})
print(dict)
A. "Joey":1,"Rachel":2,"Phoebe":2
B. {"Joey":1,"Rachel":2}
C. {"Joey":1,"Phoebe":2}
D. Error
View Answer

Create Account