0

Well, i believe an example will provide a better understanding:

class FileFormats():

    def __init__(self):

        self.a_set = {gif, jpg, png}


    def add_value(self, a_value):
        self.a_set.update(a_value)

I tested and it doesn't work (and i think it's fine that it doesn't work?) I can't think of any other way to do something like that without using a '.txt' file and open(), read(), write() methods or some sort of database. But maybe there's another way i can get persistence and maybe some of you people could enlighten me?

I believe there's a very simple answer and probably i missed something on my python lessons, so, if you just tell me google this or that i would be completely fine with that.

Thank you.

4

0 回答 0