Nilai non-nol terakhir Python dalam daftar
>>> import numpy as np
>>> np.max(np.nonzero([-2, -2, 0, 0, 0, 0, 0]))
1 # at index 1
>>> np.max(np.nonzero([-2, 20, -1, 0, 3, 0, 0]))
4 # at index 4
Powerful Penguin