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

后端 未结 1 1062
深忆病人
深忆病人 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)
提交回复
热议问题