How can I use variables to format my variables?
cart = {\"pinapple\": 1, \"towel\": 4, \"lube\": 1} column_width = max(len(item) for item in items) for item, qty
Okay, problem solved already, here's the answer for future reference: variables can be nested, so this works perfectly fine:
for item, qty in cart.items(): print "{0:{1}} - {2}".format(item, column_width, qty)