page-banner
Chapter-7 File Processing
Q11.
रवि ने open() फ़ंक्शन का उपयोग करके पायथन में एक फ़ाइल खोली लेकिन मोड निर्दिष्ट करना भूल गया। फ़ाइल किस मोड में खुलेगी?<break-line><break-line>Ravi opened a file in python using open( ) function but forgot to specify the mode. In which mode the file will open?
A. write
B. append
C. read
D. Both read and write
View Answer
Q12.
कौन सा कथन फ़ाइल पॉइंटर को वर्तमान स्थिति से 10 बाइट्स पीछे ले जाएगा?<break-line><break-line>Which statement will move file pointer 10 bytes backward from current position?
A. f.seek(-10,0)
B. f.seek(-10,1)
C. f.seek(10,0)
D. None of the above
View Answer
Q13.
कौन सा कथन एक फ़ाइल से एक पंक्ति लौटाएगा यदि फाइल ऑब्जेक्ट f हो<break-line><break-line>Which statement will return one line from a file (file object is “f”)?
A. f.readlines()
B. f.readline()
C. f.read()
D. f.line()
View Answer
Q14.
यदि फ़ाइल मौजूद नहीं है तो कौन सा मोड एक नई फ़ाइल बनाता है?<break-line><break-line>Which mode creates a new file if the file does not exist?
A. write mode
B. append mode
C. both (A) & (B)
D. none of the above
View Answer
Q15.
पायथन में कौन सा फ़ंक्शन फ़ाइल खोलता है?<break-line><break-line>Which function opens file in python?
A. open()
B. Open()
C. new()
D. None of above
View Answer