Created
December 4, 2020 23:58
-
-
Save maiamcc/f529589b6b7de802f7b0eb977b57bb65 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xfile = open('advent_day1.txt') | |
inp= xfile.read() | |
# you've got a big string that's many lines of text, and each line is a number. | |
inp = inp.trim() # get rid of extra space on either side of the big string | |
lines = inp.split('\n') # make a list by splitting on every linebreak (\n is the newline character) | |
ints = [] | |
for line in lines: | |
ints.append(int(line)) # make sure the elements in your list are numbers you can do math with, not just strings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment