I'm working with a LIST that am getting from a soup which after the clean up gives me:
lists of variable length ['7.0', '7.5', '6.8', '6.9'] or ['7.0', '7.5']
so my problem is when I try formating the output:
code snippet:
if grades:
print '\r\n["' + str(student[0]),
if len(grades) == 1:
print
print ('%s'*len(grades)) % tuple(grades)
the output of this is:
["John Doe 7.0 7.5 6.8 6.9
however what I need is:
["John Doe, ["7.0","7.5"],["6.8","6.9"]] or ["John Doe, ["7.0","7.5"]]
I've tried with Formatter and Template and seems can't be done with those.
thank you