Home

Designed for school students & undergraduate entrance aspirants preparing for board exams, NEET, JEE and more.

JEE (Mains & Adv)NEET (UG)CBSE BoardISC BoardUP BoardCUET

Built for graduates & professionals targeting competitive exams — UPSC, CAT, GMAT, GRE, IELTS, banking & more.

GREGMATCATUPSCIBPSIELTSTOEFLSATACT

Core school & undergraduate subjects aligned with CBSE, ISC, UP Board, NEET and JEE syllabi.

PracticeMock TestsResources

Computer Science > Computational Thinking And Programming 2 > Data File Handling

Success Rate: 0%
Single Question

Keshav is the IT Head in a hospital. He needs to manage the records of all the doctors in the hospital. For this, he wants to store the following information of each doctor in a file:

  • D_ID
    : An integer to store Doctor ID.
  • D_Name
    : A string to store doctor's name.
  • D_Dept
    : A string to store the Department of the doctor. (Surgery, Radiology, etc.)
  • Experience
    : An integer to store doctor's experience (in years)

For example, a doctor's information may be:

[1256, "R. Gupta", "Cardiology", 15]

As an applicant for the post of a Programmer, you have to answer the following questions in this context: (I) Write one difference of storing this data in a binary file over a CSV file. (II) Assume that the data is stored in a binary file, named

DOCTORS.DAT
, and each record is stored as a list. Write a function, in Python, to read and display all the records from the file
DOCTORS.DAT
. (III) Write a function
addDoctor()
, in Python, which accepts a doctor's data from the user and writes it in the file
DOCTORS.DAT
.

Edvaya Target App Icon

Edvaya Target

Board & Competitive Exams Made Easy

Edvaya Target is built for students preparing for JEE (Main & Advanced), NEET UG, and Board Exams (CBSE, ISC & State Boards) — using a practice-first approach that actually works.

Get it on Google Play

Current Question

Attempts0/3
StatusNot Answered
Ready to Answer! 🚀

Community Stats

Active Learners30
Questions Attempted560
Community Success Rate71%

Track Your Progress

Sign up to save your practice progress, add favorites, and get personalized insights.

Quick Actions

We Value Your Privacy

Edvaya uses cookies to enhance your learning experience, analyze platform usage, and provide personalized content. You can customize your preferences or accept all cookies to continue.

By continuing, you agree to our Cookie Policy and Privacy Policy