Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Sachin Kanchan564 Points
EXTRA CREDIT after the REFACTOR Challenge
""" Add a "SAVE" option to your script. Use the open function to open a file and save your shopping list to it.
Then use a for loop on the file to read each line in the file. Add each line to your shopping_list variable when your file first runs.
Your list is now more permanent! """
Did anyone do this - EXTRA CREDIT challenge - after Refactor.
The link that the "open" provides to, I tried reading it. Doesn't make sense to me :|
Jeffrey Duarte9,706 Points
For introductory stages the open() function can be called as
The additional arguments that you see in the docs all have defaults and don't have to be adjusted. There is a small chart in the docs that explains what the defaults mean, but for the purpose of the extra credit you only have to pass in the text file you're looking to open.
I hope this helps.