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.
Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 13 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.
Hi, it looks like you're using AdBlock :(
Displaying ads are our only source of revenue. To help Teachoo create more content, and view the ad-free version of Teachooo... please purchase Teachoo Black subscription.