I want python to do something similar to MS Excel =ROUNDDOWN (number, num_digits)
. So in my example which looks like this
a = [3.5, 43.689, 113.225, 65.4545]
I tried like this:
a = [3.5, 43.689, 113.225, 65.4545]
b = [str(i).split(".") for i in a]
c = [i[0] for i in b]
d = [i[1][0] for i in b]
e = list(zip(c,d))
f = [float(".".join(i)) for i in e]
which gave an OUTPUT i need:
>>> print (f)
[3.5, 43.6, 113.2, 65.4]
Is there a better and simplest way to do the above in Python?