pref = [0]_ = input()for liczba in map(int, input().split()): pref.append(pref[-1]+liczba)print(pref)
6 5 1 3 4 5 6 7 2 3 6 6 7
[0, 1, 4, 8, 13, 19, 26]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!