CBSE Class 12 Computer Science Question 67 of 136

Data File Handling — Question 6

Back to all questions
6
Question

Question 6

What would be the data type of variable data in the following statements?

  1. data = f.read()
  2. data = f.read(10)
  3. data = f.readline()
  4. data = f.readlines()
Answer
  1. data = f.read() — Variable data will be string data type.
  2. data = f.read(10) — Variable data will be string data type.
  3. data = f.readline() — Variable data will be string data type.
  4. data = f.readlines() — Variable data will be list data type.