Python Help Made List Python Hundred Pieces Data Would Get First Every Tenth Piece Data Su Q37297639

Python help

i have made a list in python with a few hundred pieces of datahow would i get the first and every tenth piece of data and sumthem together?


Answer


#sample datadata = [3,2,4,1,7,5,6,9,8,9,13,4,3,32,5,6,9,8,4,3,32,5]s = 0for i in range(0,len(data),10): print(str(i)+”th index value is:”,data[i]) s += data[i]print(“Sum =”,s)

color{blue}underline{Output:}

0th index value is: 310th index value is: 1320th index value is: 32Sum = 48

Please upvote the solution if it helped. Thanks!

We were unable to transcribe this imagePlease upvote the solution if it helped. Thanks!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.