page-banner
Chapter-7 File Processing
Q21.
स्टेटमेंट 4 के लिए उत्तर चुनें।<break-line><break-line>Choose the answer for statement 4.<pre><code>import __________ # statement 1 rec = [] while True: rn = int(input("Enter")) nm = input("Enter") temp = [rn, nm] rec.append(temp) ch = input("Enter choice (Y/N)") if ch.upper() == "N": break f = open("stud.dat", " __________ ") # statement 2 __________.dump(rec, f) # statement 3 __________.close() # statement 4</code></pre>
A. f
B. rec
C. file
D. stud
View Answer
Q22.
निम्नलिखित कोड का आउटपुट क्या होगा?<break-line><break-line>What will be the output of the following code?<pre><code>f=open("demo.txt","r") print(f.tell())</code></pre>
A. 1
B. 2
C. -1
View Answer
Q23.
निम्नलिखित कोड का आउटपुट क्या होगा?<break-line><break-line>What will be the output of the following code?<pre><code>f=open("demo.txt","w+") f.write("Welcome to Python") f.seek(5) a=f.read(5) print(a)</code></pre>
A. Welco
B. me to
C. Welcome to Python
D. e to
View Answer
Q24.
os.getlogin() क्या लौटाता है?<break-line><break-line>What does os.getlogin() return?
A. वर्तमान लॉगिन उपयोगकर्ता का नाम/Name of the current user logged in
B. एक अलग उपयोगकर्ता के रूप में लॉगिन करने के लिए फ़ॉर्म प्राप्त करता है/Gets a form to login as a different user
C. सुपरयूज़र का नाम/Name of the superuser
D. उपरोक्त सभी/All of the above
View Answer
Q25.
निम्नलिखित में से कौन सा फ़ंक्शन दो आर्गुमेंट लेता है?<break-line><break-line>Which of the following function takes two arguments?
A. load()
B. dump()
C. उपरोक्त दोनों/Both of above
D. उपरोक्त में से कोई नहीं/None of above
View Answer