File Processing in Python

1 / 64

what is the value stored in sys.argv[0]?
sys.argv[0] में संग्रहीत मान क्या है?

2 / 64

How do you close a file object (fp)?
आप फ़ाइल ऑब्जेक्ट (fp) को कैसे बंद करते हैं?

3 / 64

To open a file c:\scores.txt for reading, we use _____________
पढ़ने के लिए फ़ाइल c:\scores.txt खोलने के लिए, हम _____________ का उपयोग करते हैं

4 / 64

What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
f = None
for i in range (5):
with open("data.txt", "w") as f:
if i > 2:
break
print(f.closed)

5 / 64

To open a file c:\scores.txt for writing, we use ____________
लिखने के लिए c:\scores.txt फ़ाइल खोलने के लिए, हम ____________ का उपयोग करते हैं

6 / 64

To read the next line of the file from a file object infile, we use ____________
फ़ाइल ऑब्जेक्ट इनफ़ाइल से फ़ाइल की अगली पंक्ति पढ़ने के लिए, हम ____________ का उपयोग करते हैं

7 / 64

Which of the following are the modes of both writing and reading in binary format in file?
निम्नलिखित में से कौन-से फ़ाइल में बाइनरी प्रारूप में लिखने और पढ़ने के तरीके हैं?

8 / 64

method is used to display entire contents of the file
फ़ाइल की संपूर्ण सामग्री प्रदर्शित करने के लिए विधि का उपयोग किया जाता है

9 / 64

How do you change the file position to an offset value from the start?
आप फ़ाइल की स्थिति को प्रारंभ से ही ऑफसेट मान में कैसे बदलते हैं?

10 / 64

correct syntax of file.writelines() is?
file.writelines() का सही सिंटैक्स क्या है?

11 / 64

What is the use of truncate() method in file?
फ़ाइल में truncate() विधि का उपयोग क्या है?

12 / 64

How do you rename a file?
आप किसी फ़ाइल का नाम कैसे बदलते हैं?

13 / 64

Which of the following is not a valid attribute of a file object (fp)?
निम्नलिखित में से कौन सा फ़ाइल ऑब्जेक्ट (fp) की वैध विशेषता नहीं है?

14 / 64

What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
fo = open("foo.txt", "rw+")
print "Name of the file: ", fo.name

# Assuming file has following 5 lines
# This is 1st line
# This is 2nd line
# This is 3rd line
# This is 4th line
# This is 5th line

for index in range(5):
line = fo.next()
print "Line No %d - %s" % (index, line)

# Close opened file
fo.close()

15 / 64

What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
import sys
sys.stdout.write(' Hello\n')
sys.stdout.write('Python\n')

16 / 64

What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
str = input("Enter your input: ");
print "Received input is : ", str

17 / 64

To read the remaining lines of the file from a file object infile, we use ____________
फ़ाइल ऑब्जेक्ट इनफ़ाइल से फ़ाइल की शेष पंक्तियों को पढ़ने के लिए, हम ____________ का उपयोग करते हैं

18 / 64

What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
str = raw_input("Enter your input: ");
print "Received input is : ", str

19 / 64

Which are the two built-in functions to read a line of text from standard input, which by default comes from the keyboard?
मानक इनपुट से पाठ की एक पंक्ति को पढ़ने के लिए दो अंतर्निहित फ़ंक्शन कौन से हैं, जो डिफ़ॉल्ट रूप से कीबोर्ड से आते हैं?

20 / 64

What is the pickling?
pickling क्या है?

21 / 64

What will be the output of the following Python code? (If entered name is sanfoundry)
निम्नलिखित पायथन कोड का आउटपुट क्या होगा? (यदि नाम sanfoundry दर्ज किया गया है)
import sys
print 'Enter your name: ',
name = ''
while True:
c = sys.stdin.read(1)
if c == '\n':
break
name = name + c

print 'Your name is:', name

22 / 64

Correct syntax of file.readlines() is?
File.readlines() का सही सिंटैक्स क्या है?

23 / 64

which one of the following is not attributes of file?
निम्नलिखित में से कौन-सा एक फ़ाइल की विशेषता नहीं है?

24 / 64

Which of the following statements are true?
निम्नलिखित में से कौन से कथन सत्य हैं?

25 / 64

if argument is 0, then
यदि argument 0 है, तो

26 / 64

Correct syntax of file.writelines() is?
File.writelines() का सही सिंटैक्स क्या है?

27 / 64

Which is/are the basic I/O connections in file?
फ़ाइल में मूल I/O कनेक्शन कौन सा है/हैं?

28 / 64

What is the use of seek() method in files?
फ़ाइलों में seek() विधि का उपयोग क्या है?

29 / 64

Is it possible to create a text file in python?
क्या पायथन में टेक्स्ट फ़ाइल बनाना संभव है?

30 / 64

Which one of the following is not attributes of file?
निम्नलिखित में से कौन सी फ़ाइल की विशेषता नहीं है?

31 / 64

which of the following mode argument is used to truncate?
निम्नलिखित में से कौन सा मोड तर्क ट्रंकेट करने के लिए उपयोग किया जाता है?

32 / 64

Which function is used to write a list of string in a file?
किसी फ़ाइल में स्ट्रिंग की सूची लिखने के लिए किस फ़ंक्शन का उपयोग किया जाता है?

33 / 64

What is the use of tell() method in python?
पायथन में tell() विधि का उपयोग क्या है?

34 / 64

What is the use of “a” in file handling?
फ़ाइल हैंडलिंग में “a” का क्या उपयोग है?

35 / 64

What is unpickling?
अनपिकलिंग क्या है?

36 / 64

Which function is used to read all the characters?
सभी अक्षरों को पढ़ने के लिए किस फ़ंक्शन का उपयोग किया जाता है?

37 / 64

What is the current syntax of rename() a file?
किसी फ़ाइल का नाम बदलने (rename()) का वर्तमान सिंटैक्स क्या है?

38 / 64

To open a file c:\scores.txt for appending data, we use ____________
डेटा जोड़ने के लिए c:\scores.txt फ़ाइल खोलने के लिए, हम ____________ का उपयोग करते हैं

39 / 64

What is the current syntax of remove() a file?
किसी फ़ाइल को remove() करने का वर्तमान सिंटैक्स क्या है?

40 / 64

Which of the following is not a valid mode to open a file?
निम्नलिखित में से कौन सा फ़ाइल खोलने का वैध तरीका नहीं है?

41 / 64

the …….method returns our current position (in number of bytes).
…….विधि हमारी वर्तमान स्थिति (बाइट्स की संख्या में) लौटाती है।

42 / 64

To read the entire remaining contents of the file as a string from a file object infile, we use ____________
फ़ाइल ऑब्जेक्ट इनफ़ाइल से फ़ाइल की संपूर्ण शेष सामग्री को एक स्ट्रिंग के रूप में पढ़ने के लिए, हम ____________ का उपयोग करते हैं

43 / 64

What is the use of “w” in file handling?
फ़ाइल हैंडलिंग में "w" का क्या उपयोग है?

44 / 64

what is the current syntax of remove() a file?
किसी फ़ाइल को remove() करने का वर्तमान सिंटैक्स क्या है?

45 / 64

To read two characters from a file object infile, we use ____________
फ़ाइल ऑब्जेक्ट से दो अक्षर पढ़ने के लिए, हम ____________ का उपयोग करते हैं

46 / 64

How do you get the current position within the file?
आप फ़ाइल में वर्तमान स्थिति कैसे प्राप्त करेंगे?

47 / 64

Which function is used to read single line from file?
फ़ाइल से सिंगल लाइन पढ़ने के लिए किस फ़ंक्शन का उपयोग किया जाता है?

48 / 64

What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
fo = open("foo.txt", "wb")
print "Name of the file: ", fo.name
fo.flush()
fo.close()

49 / 64

which function is used to read single line from file?
फ़ाइल से सिंगल लाइन पढ़ने के लिए किस फ़ंक्शन का उपयोग किया जाता है?

50 / 64

What is the difference between r+ and w+ modes?
r+ और w+ मोड के बीच क्या अंतर है?

51 / 64

to open a file c:/akitsolution.txt for reading, we use
c:/akitsolution.txt फ़ाइल को पढ़ने के लिए खोलने के लिए, हम उपयोग करते हैं

52 / 64

What happens if no arguments are passed to the seek function?
यदि सीक फ़ंक्शन को कोई argument नहीं दिया जाता है तो क्या होगा?

53 / 64

which of the following is correct to identify the right way to close a file
किसी फ़ाइल को बंद करने का सही तरीका पहचानने के लिए निम्न में से कौन सा सही है

54 / 64

In file handling, what does this terms means “r, a”?
फ़ाइल हैंडलिंग में, इस शब्द " r, a " का क्या अर्थ है?

55 / 64

How do you get the name of a file from a file object (fp)?
आप फ़ाइल ऑब्जेक्ट (fp) से फ़ाइल का नाम कैसे प्राप्त करते हैं?

56 / 64

the most basic task involved in file manipulation are:
फ़ाइल मैनिपुलेशन में शामिल सबसे बुनियादी कार्य हैं:

57 / 64

Which of the following mode will refer to binary data?
निम्नलिखित में से कौन सा मोड बाइनरी डेटा को संदर्भित करेगा?

58 / 64

which of the following mode will refer to binary data?
निम्नलिखित में से कौन सा मोड बाइनरी डेटा को संदर्भित करेगा?

59 / 64

What is the correct syntax of open() function?
open() फ़ंक्शन का सही सिंटैक्स क्या है?

60 / 64

Which function is used to write all the characters?
सभी कैरेक्टर्स को लिखने के लिए किस फंक्शन का उपयोग किया जाता है?

61 / 64

f.seek(0) is used to
f.seek(0) का प्रयोग किया जाता है

62 / 64

How do you delete a file?
आप किसी फ़ाइल को कैसे हटाते हैं?

63 / 64

The readlines() method returns ____________
readlines() विधि ____________ लौटाती है

64 / 64

Which function is used to close a file in python?
पायथन में फ़ाइल को बंद करने के लिए किस फ़ंक्शन का उपयोग किया जाता है?

Your score is

The average score is 54%

0%