python 输出字符串如果遇到字典

>>> d = {'a':1}
>>> print '%s' % 1,d
1 {'a': 1}
>>> print '%s %s' % 1,d
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not enough arguments for format string

 

posted @ 2014-09-28 02:35  wuhn  阅读(403)  评论(0编辑  收藏  举报