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
  • 112,593
  • 23
  • 157
  • 280
rajkris
  • 1,699
  • 1
  • 7
  • 14

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,333
  • 9
  • 20