I have this code:
data = [["apple", 2], ["cake", 7], ["chocolate", 7], ["grapes", 6]]
I want to nicely put it on display when running my code so that you won't see the speech marks,or square brackets, have it displayed like so:
apple, 2
cake, 7
chocolate, 7
grapes, 6
I looked on this site to help me:
http://www.decalage.info/en/python/print_list
However they said to use print("\n".join)
, which only works if values in a list are all strings.
How could I solve this problem?