Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Advent of Code
#4
You're almost there.

All you need to do now, is to loop through the list of int values, adding each one to a total, until you hit your separators, then append the total to a new list, reset the total to zero, and go again. Once that's done, you can use the max() function, on the totals list, to get the max value.

Hint:
for number in newList:
    print(number)
That's how I would do it, but I'm sure there's more than one way.
Sig:
>>> import this

The UNIX philosophy: "Do one thing, and do it well."

"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse

"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
Reply


Messages In This Thread
Advent of Code - by astral_travel - Dec-05-2022, 06:36 PM
RE: Advent of Code - by deanhystad - Dec-05-2022, 06:48 PM
RE: Advent of Code - by astral_travel - Dec-05-2022, 06:49 PM
RE: Advent of Code - by rob101 - Dec-05-2022, 07:07 PM
RE: Advent of Code - by deanhystad - Dec-05-2022, 07:31 PM
RE: Advent of Code - by astral_travel - Dec-05-2022, 08:09 PM
RE: Advent of Code - by astral_travel - Dec-05-2022, 07:53 PM
RE: Advent of Code - by deanhystad - Dec-05-2022, 08:08 PM
RE: Advent of Code - by astral_travel - Dec-05-2022, 08:12 PM
RE: Advent of Code - by deanhystad - Dec-05-2022, 08:40 PM
RE: Advent of Code - by astral_travel - Dec-05-2022, 09:06 PM
RE: Advent of Code - by snippsat - Dec-05-2022, 09:41 PM
RE: Advent of Code - by deanhystad - Dec-05-2022, 09:50 PM
RE: Advent of Code - by snippsat - Dec-05-2022, 09:58 PM
RE: Advent of Code - by astral_travel - Dec-05-2022, 10:06 PM
RE: Advent of Code - by deanhystad - Dec-05-2022, 11:49 PM
RE: Advent of Code - by astral_travel - Dec-06-2022, 04:47 PM
RE: Advent of Code - by deanhystad - Dec-06-2022, 05:10 PM
RE: Advent of Code - by astral_travel - Dec-06-2022, 05:37 PM
RE: Advent of Code - by deanhystad - Dec-06-2022, 05:37 PM
RE: Advent of Code - by astral_travel - Dec-06-2022, 05:54 PM
RE: Advent of Code - by deanhystad - Dec-06-2022, 06:27 PM
RE: Advent of Code - by astral_travel - Dec-06-2022, 06:50 PM
RE: Advent of Code - by deanhystad - Dec-06-2022, 07:38 PM
RE: Advent of Code - by snippsat - Dec-06-2022, 07:50 PM
RE: Advent of Code - by astral_travel - Dec-06-2022, 08:41 PM
RE: Advent of Code - by deanhystad - Dec-06-2022, 09:19 PM
RE: Advent of Code - by astral_travel - Dec-06-2022, 09:35 PM
RE: Advent of Code - by deanhystad - Dec-06-2022, 09:53 PM
RE: Advent of Code - by astral_travel - Dec-07-2022, 05:14 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020