CBSE Class 12 Computer Science
Question 98 of 136
Data File Handling — Question 37
Back to all questionsLet the file "emp.txt" include the following sample text:
1001, Ankit Singh, 50000, Manager
1002, Neha Patel, 45000, Developer
file = open("emp.txt", "a")
file.write("1003, Manoj Tiwari, 48000, Analyst\n")
file.write("1004, Aarti Gupta, 52000, Engineer\n")The file "emp.txt" include the following text:
1001, Ankit Singh, 50000, Manager
1002, Neha Patel, 45000, Developer
1003, Manoj Tiwari, 48000, Analyst
1004, Aarti Gupta, 52000, Engineer