In python2, if I want to print something like:
print 'enrollment:' + str(len(enrollment))
print 'submissions:' + str(len(submissions))
I need to output the title and the length ; tried to format:
print ('%d:' + str(len('%d'))) %enrollment
which gives me:
"TypeError: %d format: a number is required, not dict"
BTW both "enrollment" and "submissions" are variables storing dictionary
Is there a way to apply a placeholder for both string and the variable name?