Given a string containing letters and numbers, the implicit value of the string is the integer value obtained by removing the letters and then reading out the digits.
For example, the implicit value of 16Dec2019 is
and the implicit value of a1B2c3D is
.
The implicit value of a string without digits is zero.
Write a function i_val(lst) that receives a list of
strings made up of letters and numbers, and returns the corresponding
list of implicit values, sorted by their nummerical value.
>>> i_val(['Dec16of2019', 'a1B2c3D']) [123, 162019] >>> i_val(['a21', 'b2']) + i_val(['1j5k']) [2, 21, 15] >>> i_val(['456x654', 'NoDigitsHere', 'xyz7zxy', '007Bond', '']) [0, 0, 7, 7, 456654] >>> i_val([]) []