0

Here's the basic code I'm working with:

hobbies = []

for i in range(3):
    hobby = raw_input("What are your three favorite hobbies?")
    hobbies.append(hobby)

print hobbies

My answers were "ok", "k", "ok". The hobbies list will print:

[u'ok', u'k', u'ok']

What's with the "u"?

wahoowa
  • 45
  • 8
  • 3
    `u` stands for [unicode](https://docs.python.org/2/howto/unicode.html) – TemporalWolf Jan 04 '17 at 22:46
  • Instead try `print(', '.join(hobbies))` – Paul Rooney Jan 04 '17 at 22:48
  • That should not be something that you should worry about. Like the first comment said, It only states that the text is in unicode. This will not affect the printing each individual hobby. If for aesthetic reasons you want to print it out without the `u` you could `map(lambda x: x.encode('ascii'), hobbies` before printing `hobbies` – Abass Sesay Jan 04 '17 at 23:45

0 Answers0