Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

julio cesar
2,731 PointsPython extra credit problem
i did the extra credit for the shopping list project but when i check the file i created for the list, the list horizontal not vertical like a list, how can i make it vertical?
2 Answers

Freddy Venegas
1,226 PointsI did this like so,
def open_save():
with open('list.txt', 'w') as l:
for items in shopping_list:
l.write(str(items) + "\n")
and that seemed to work. By adding the "\n" you create a new line.
Out of curiosity, how did you get the contents from the file to read into your list when the file first runs? I am stuck on that step.

Fred Young
15,523 PointsWhat does your print statement look like?
julio cesar
2,731 Pointsjulio cesar
2,731 Pointstry my code it completely works, just add the .txt when u name your file like "name.txt", and thanks btw it really helped me.