I have a list like this:
la = [3, 7, 8, 9, 50, 100]
I am trying to convert the list into string and add percentage like this:
3%, 7%, 8% and lastly 100%
I doing like this:
str1 = '%, '.join(str(e) for e in sorted_list)
It does the right thing except there’s no percentage at last i.e only 100 but I want 100%. How can I do this? Thanks
Thy this:
Which creates a list of all of them converted to strings with a percent.
If you still want a string, you can slightly modify it like this: