Explore Westonci.ca, the premier Q&A site that helps you find precise answers to your questions, no matter the topic. Explore our Q&A platform to find reliable answers from a wide range of experts in different fields. Experience the convenience of finding accurate answers to your questions from knowledgeable experts on our platform.

Question 1.
Write a function called ReadTextFile that accepts a string path to the provided file as an
argument, opens the file, splits the file on spaces, and then returns a list of those strings.
• Arguments: String - a path to the puppy.txt file
• Return: A list of strings


Sagot :

#python code

def ReadTextFile(string):

with open(string, "r", encoding="utf-8") as file:

return file.read().split(" ")

print(ReadTextFile("puppy.txt"))

cmd |> ['text', 'text']

By the way, you can look into the Russian community "brainly", I published a lot of similar code there.

znanija.com/app/profile/21571307