Menu

[solved]-Write Python Program Using Class Named Example Accept Name Content File Use Functions Retu Q39006064

Write a python program:

using class named Example. it will accept a name, the content ofthe file. we will use few functions to return the name of the file,owner, set date (time it was created the file), we can also add aline and delete a line from the file. another function that returnsall the data in the file. and one that deletes any previous andsets any new data user enters.

we can do like Test=”a”,”this is the file data”

every time we make an object, we need to keep count to numberthe file number.

just make a class that takes in a file name and datathen the user can acess those data, add a text to the data ,set a owener name for the file like setowner and get owner.
class
contructor(self, filename, file(text data):
get file() returns the filesetowner sets an owner empty by defaultgetownerdelte a line from the file (takes in a line number)get content() returns the filesets content: deltes everythjg on thr file and adds next textthat is from thr user.check for a word in the file which is given by the user
everything is done using like commands not asking user toenter anything.

a=class(“filename”,”this is thr text in thr file”
a.setowner and alll.

Expert Answer


Answer to Write a python program: using class named Example. it will accept a name, the content of the file. we will use few funct… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *