Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please give the explanations! Thx! part 1 part 2 1l def saveList (myList, myPilename): 2 outputRile-open (myFilename, 3 for item in myList: outputFile.write (item
please give the explanations! Thx!
part 1
part 2
1l def saveList (myList, myPilename): 2 outputRile-open (myFilename, " 3 for item in myList: outputFile.write (item "n outputFile.close) 61 7| def loadList (myFilename) : 9 inputFile - open(myPilename, "r") 10 for line in inputFile: newList.append (line) 12 return newList Above are the definitions of a function that will save a list of strings to a file, and a function that will load a list from a file. However, they don't quite work as intended. Which of the following problems presently occurs? Every time the list is saved and then loaded, one item is lost because saveList) saves one too few items Every time the list is saved and then loaded, one item is lost because loadListo loads one too few items. Every time the list is saved and then loaded, extra blank lines are added between every list item Every time the list is saved and then loaded, any line breaks present are lost and the text is merged onto one line. Every time the list is saved and then loaded, the previous file is overwritten
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started