[docs] python bug i thinkso

Sandro Tosi sandro.tosi at gmail.com
Sat Jun 16 23:47:13 CEST 2012


Hello,
this mailing list is about bugs/enhancements to CPython documentation,
and your email doesn't fit this description. I'd suggest to contact a
user support forum, such as
http://mail.python.org/mailman/listinfo/python-list

Anyway...

On Sat, Jun 9, 2012 at 10:04 PM, e.kirton <teejahkirton at live.com> wrote:
>   File "C:\Python32\my.py", line 8, in <module>
>
>     print ('answer') + repr (ans)
>
> TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

because you're summing "print ('answer')" with "repr(ans)"; if you
want to print 'answer' and the sum, then you can't use '+' this way
but f.e. the string formatting syntax:
http://docs.python.org/py3k/library/string.html#format-examples

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


More information about the docs mailing list