#Author: James Tam #Version: October 30, 2024 #Learning objective: #*Writing the contents of a list to a file. myContacts = ["Stacey Hearn", "Jamie Smythe", "Jessie Ying", "Jessica Gravowski"] aFile = open("contact_list.txt","w") maxContacts = len(myContacts) i = 0 #Number of file writes depends upon the size of the list while(i < maxContacts): print("Writing information for %s to file." %(myContacts[i])) aFile.write(myContacts[i] + "!\n") i += 1 #Same as i = i + 1 aFile.close()