Why do I get the error “TypeError: coercing to Unicode: need string or buffer, int found”?

后端 未结 1 1063
深忆病人
深忆病人 2021-02-05 07:31

After running this small program:

#!/usr/bin/env python2.7
# -*-coding:utf-8 -*
a = 1
b = 2
c = 3
title = u\"\"\"a=\"\"\" + a + u\"\"\", b=\"\"\" + str(b) + \\
          


        
1条回答
  •  余生分开走
    2021-02-05 08:05

    You didn't wrap a in a str call. You need to do str(a) where you have a, just like you did for b and c.

    0 讨论(0)
提交回复
热议问题