Seperating list by decimal in Python
Here is my current list:
x = [1.0, 0.0, 3.5, 1.2, 5.4]
and here is what I want:
newx = [1, 0, 0, 0, 3, 5, 1, 2, 5, 4]
I just need to split the list at the decimal point and do not want any
extra zeros added to the new list. Seems like there should be a simple
solution I just don't know about since I am so new.
No comments:
Post a Comment