0

I have a list of id's and I am trying the following below:

final = "ids: {}".format(tuple(id_list))

For some reason I am getting the following:

"ids: (u'213231231', u'weqewqqwe')

Could anyone help out on why the u is coming inside my final string. When I am trying the same in another environment, I get the output without the u''. Any specific reason for this?

martineau
  • 119,623
  • 25
  • 170
  • 301
rajkris
  • 1,775
  • 1
  • 9
  • 16

1 Answers1

0

Actually it is unicode strings in python

for literal value of string you can fist map with str

>>> final = "ids: {}".format(tuple(map(str, id_list)))

>>> final
"ids: ('213231231', 'weqewqqwe')
Saleem Ali
  • 1,363
  • 11
  • 21