page-banner
Chapter-7 File Processing
Q21.
स्टेटमेंट 4 के लिए उत्तर चुनें।

Choose the answer for statement 4.
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
A. f
B. rec
C. file
D. stud
View Answer
Q22.
निम्नलिखित कोड का आउटपुट क्या होगा?

What will be the output of the following code?
f=open("demo.txt","r")
print(f.tell())
A. 1
B. 2
C. -1
View Answer
Q23.
निम्नलिखित कोड का आउटपुट क्या होगा?

What will be the output of the following code?
f=open("demo.txt","w+")
f.write("Welcome to Python")
f.seek(5)
a=f.read(5)
print(a)
A. Welco
B. me to
C. Welcome to Python
D. e to
View Answer
Q24.
os.getlogin() क्या लौटाता है?

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.
निम्नलिखित में से कौन सा फ़ंक्शन दो आर्गुमेंट लेता है?

Which of the following function takes two arguments?
A. load()
B. dump()
C. उपरोक्त दोनों/Both of above
D. उपरोक्त में से कोई नहीं/None of above
View Answer

Create Account