Self Studies

File Handling T...

TIME LEFT -
  • Question 1
    1 / -0.25

    What happens when the following statement is executed and file1.txt is not present in the current directory?
    file_obj = open("file1.txt ", "r ")
    (1) Python creates a new file ‘file1.txt ’
    (2) Raises a FileNotFoundError
    (3) Raises an IOError
    (4) Does nothing

  • Question 2
    1 / -0.25

    Select the statement that is not true for r+ mode.
    (1) If the file does not exist, it gives an error.
    (2) Both reading and writing can be performed.
    (3) If the file does not exist, it creates a new file.
    (4) Existing data is not truncated.

  • Question 3
    1 / -0.25

    What is the full form of CSV file?
    1) Colon Separated Values
    2) Context Separated Values
    3) Comma Separated Values
    4) Caps Separated Values

  • Question 4
    1 / -0.25

    Which of the following option is true?
    fp.seek(10, 1)
    (1) Move file pointer ten characters behind from the current position.
    (2) Move file pointer ten characters ahead from the current position.
    (3) Move file pointer ten characters ahead from the beginning of a file.
    (4) Move file pointer ten characters behind ahead from the end of a file.

  • Question 5
    1 / -0.25

    What is the full form of CSV file?

  • Question 6
    1 / -0.25

    Match the following Set 1 to set 2.

  • Question 7
    1 / -0.25

    The following functions are used to access data randomly.

  • Question 8
    1 / -0.25

    Which one is the following advantage of using with clause while opening a file.

  • Question 9
    1 / -0.25

    A ___________ method is used to position the file object at a particular position in a file.

  • Question 10
    1 / -0.25

    Which method is used to rename the file or folder?

  • Question 11
    1 / -0.25

    Which of the following is an invalid file mode?

  • Question 12
    1 / -0.25

    The following code will perform which operation?
    object.readline(10)

  • Question 13
    1 / -0.25

    Serialisation is also known as____________.

  • Question 14
    1 / -0.25

    You are given the text file, file1.txt whose contents are:

    hello everyone

    today is a monday

    all the best for your exams

     

    What will be the output of the following code?

    myfile = open("file1.txt ", "r ")

    str = myfile.readline(20)

    print(str)

    myfile.close()

  • Question 15
    1 / -0.25

    With reference to file handling in Python, which of the following statement(s) is/are true?
    a. The file seek points are 0, 1, and 2.
    b. The seek() function works differently for text and binary files.
    c. When a file is opened in binary mode, the seek() method can have a negative offset value.
    d. The offset in the seek() function specifies the number of bits by which the file pointer is to be moved.

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 15

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
Submit Test
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now