I have a list
sample_list=[-1.0, -1.0, 1.25999, 3999.0, 6999.0, 3777.0, 6888.0, 3999.0, 3999.0, 6999.0, 6999.0, 8999.0, 14.75999]
I have to find only those items which contains "999" then trim "999" from that item and then multiply with 30.
Example : if 1.25999 is the item then removing "999" ->1.25 then multiply it with 30 resulting 37.5
I have tried following code snippet:
sample_list=[-1.0, -1.0, 1.25999, 3999.0, 6999.0, 3777.0, 6888.0, 3999.0, 3999.0, 6999.0, 6999.0, 8999.0, 14.75999]
for i in sample_list:
if "999" in i:
i = i.translate(None, '999')
i=i*30
print(sample_list)
I am getting error : TypeError: argument of type 'float' is not iterable