Python prawie oprócz ostatniego elementu
# all but the last
for x in y[:-1]
-
# all but the last
for x in y[:-1]