Python oneliner to differentiate polynomial list
From wikiluntti
Introduction
Oneliners are powerful and often beautiful solutions to programming challenges (see Acklamization).
Theory
- D(poly) = 2*0 + 3*1 + 5*2 + 1*3
- Dpoly = [3, 10, 3]
poly = [2, 3, 5, 1] # Degrees starting from zero
print( [(i+1)*j for i,j in enumerate( poly[1:] )] )