I have been provided with data that contains multiple strings. I am to break it and split the data into three parts which are name, cost and items. I was thinking about creating empty lists and then appending the names/costs/items to after it's been sorted out. But as I try to append them it just gives me a loop of the split list.
sample_data = [
'Laaibah,208.10,10',
'Arnold,380.999,9',
'Sioned,327.01,1',
'Shayaan,429.50,2',
'Renee,535.29,4'
]
Outcome:
Name Cost Items
Laaibah 208.10 10
Arnold 381.00 9
Sioned 327.01 1
Shayaan 429.50 2
Renee 535.29 4
The following was provided for the formatting.
Name : Left justified in 20 places
Cost : Right justified in 6 place, 2 decimal places
Items: Right justified in 5 places