Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedpart 2

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago