About Python List Index (Paiza POH Lite 4: Mission 3)

poh_lite4_3.png

In Mission 3 of Paiza POH Lite4 1: From the input values, create a list with list = [4,5,1,10,3,4,1] 2: Extract and sum the three elements from this list as shown above, and store one group in the list "sum_list" (as in sum_list = [10,16,14,17,8]. ..)

The question is about part 2, sum_list[0:3] #10 sum_list[1:4] #16 sum_list[2:5] #14 ・ ・ ・ But how do you write a program in Python that adds and increments only the index of the list and extracts the total value of the elements of each range-specified "list"?

Or is there a way to extract and store the total value in the above figure other than the approach of extracting the total value from the index?

Recommended Posts

About Python List Index (Paiza POH Lite 4: Mission 3)
Paiza Python Primer 4: List Basics
About the basics list of Python basics
[Python] list
paiza POH ec-campaign (Python / Ruby) (not tuned well)
paiza POH ec-campaign (C # / Java / Python / Ruby) # paizahack_01
Python> list> pop ()> Get index {specified / unspecified} + del ()
About list processing (Python beginners after learning Ruby)
About python slices
About python comprehension
Python basics: list
About Python tqdm.
About python yield
About python, class
About python inheritance
About python, range ()
About python decorators
Python> Comprehension / Comprehension> List comprehension
About python reference
About Python decorators
[Python] About multi-process
Python list manipulation