Question 5 Write a method in Python to write multiple lines of text
contents into a text file, ''MYFILE.TXT'' line.
declaring function count( )
Taking a user input as ‘line’ for writing it to the file.
Invoking function write( )
opening the text file in read mode and assigning it to file_object ‘f’
Writes ‘line’ to the text file.
CA Maninder Singh
CA Maninder Singh is a Chartered Accountant for the past 12 years. He also provides Accounts Tax GST Training in Delhi, Kerala and online.