есть файл "words.txt", я должен получить к нему доступ.
WORDLIST_FILENAME = 'words.txt'
class Message(object):
def __init__(self, text):
self.text = text
'''
Initializes a Message object
text (string): the message's text
a Message object has two attributes:
self.message_text (string, determined by input text)
self.valid_words (list, determined using helper function load_words)
'''
# pass #delete this line and replace with your code here
def get_message_text(self):
'''
Used to safely access self.message_text outside of the class
Returns: self.message_text
'''
# pass #delete this line and replace with your code here
Может кто-нибудь мне помочь?






with open("words.txt", "r") as f:
a = f.read() #Now you have a string that contains the data inside .txt file
#You can do whatever you like with this data from now on