fruits = [“Apple\n”, “Orange\n”, “Grapes\n”, “Watermelon”] my_file = open(“C:/Documents/Python/test.txt”, “w”) my_file.writelines(fruits)
To embed this project on your website, copy the following code and paste it into your website's HTML: