I have three lists in Python. I want to save these lists as a semicolon delimited text file (with a heading).
For example, lets consider these three lists:
l1 = ['a1', 'a2', 'a3', 'a4', 'a5']
l2 = [1,2,3,4,5]
l3 = [20.0, 25.1, 51.2, 60.2, 75.0]
and header, ['Label1', 'Label2', 'Label3']
I want these lists to be saved as columns in a text file in the following form:
Label1; Label2; Label3
a1;1;20.0%
a2;2;25.1%
a3;3;51.2%
a4;4;60.2%
a5;5;75.0%
In addition to saving the file in the above format, I want to have percentage symbols while writing the last column. I checked this post, but I am still confused about how I can implement this. I am using python 2.7.
I will really appreciate any help.