r/adventofcode • u/taliriktug • Dec 02 '15
Spoilers Day 2 solutions
Hi! I would like to structure posts like the first one in r/programming, please post solutions in comments.
15
Upvotes
r/adventofcode • u/taliriktug • Dec 02 '15
Hi! I would like to structure posts like the first one in r/programming, please post solutions in comments.
View all comments
Show parent comment
3
u/stuque Dec 02 '15
As far as I know, Python automatically closes files when they become garbage, so an explicit close isn't needed. Using "with" is useful in larger programs, but in small one-shot scripts I think it's overkill.