Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Random SUm
#python 3.6.9 series = [-3, 2, 3, -4, 3, 1] g = 1 p = 1 total = 0 for i in range(len(series)-1,-1,-1): if(p==g): print("EQUAL VALUES") temp_ind = int((g*(g+1))/2) print(temp_ind) print(i) print(series[i:i+temp_ind]) temp_total = sum(series[i:i+temp_ind]) if temp_total > total: total = temp_total g+=1 p = 0 elif (p<g): print("NOT EQUAL VALUES") temp_ind = int((g*(g-1))/2) print(temp_ind) print(i) print(series[i:i+temp_ind]) temp_total = sum(series[i:i+temp_ind]) if temp_total > total: total = temp_total p+=1 print(total)
run
|
edit
|
history
|
help
0
Reading XML File
rectangle perimiter
Add missing names
Sk
ASICC art
Select fruits
My Intro
snake water gun game
T
kenken1