Data conversion
Hi all, I have a programming task to solve in python. I have a bunch of floats from an app that I need to convert to a readable format for another app. It needs to do a few things (can be done in any order): - read a bunch of floats (could be any amount) in a list - round them to .2 decimal places - if the float is 0.0 (app only gives 0.0), print "0" - replace/remove any symbols with spaces (" ") - no spaces at the last float (space sensitive) - can be printed as strings instead of integer (you can use string formatting) Example: floats = [3.141, 0.0, 2.71828, 1.61, 0.12345678, 0.0, ...] (could contain more than 3 decimal places) round: 3.14, 0.0, 2.72, 1.61, 0.12, 0.0 (printed on each line) zeros: 3.14, 0, 2.72, 1.61, 0.12, 0 (printed on each line) final output: 3.14 0 2.72 1.61 0.12 0 I have a code on this (hopefully this link works) but I want to know if there's a better way to type this. Would like to see your solution in python (and your explanation of it) https://code.sololearn.com/c4CUwulm90l0/#py