Making a string out of a string and an integer in Python [duplicate]

name="b" + str(num)

or

name="b%s" % num

as S.Lott notes, the mingle operator ‘%’ is deprecated for Python 3 and up. And I stole the name “mingle” from INTERCAL but that’s how I talk about it and wanted to see it in print at least once before – like the dodo – it vanishes from the face of the earth.

Leave a Comment