Ошибка типа: Format Requires Mapping

У меня есть строка и список объектов:

gpl = "%(id)s : %(atr)s"

objects = [{'id':1, 'content':[{'atr':'big', 'no':2}]},  {'id':2, 'content': [{'atr':'small', 'no':3}]}]

for obj in objects:
   for con in obj['content']:
       print gpl %(obj,con)

Я получаю:

TypeError: format requires a mapping

Как мне это напечатать? Я пытаюсь напечатать:

1 : big
2 : small

Спасибо

21
задан Neeran 3 April 2012 в 09:05
поделиться