Working out solutions for Advent of Code
Nevar pievienot vairāk kā 25 tēmas
Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
12345678910 |
- def main():
- with open("01ain.txt", "r") as file:
- lines = file.readlines()
- masses = [int(x) for x in lines]
- fuels = [(x//3) - 2 for x in masses]
- print(fuels)
- print(sum(fuels))
-
- if __name__ == "__main__":
- main()
|