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)
0th index value is: 310th index value is: 1320th index value is: 32Sum = 48
We were unable to transcribe this imagePlease upvote the solution if it helped. Thanks!