Extra u' ' in the result of "For your hobbies"


#1


https://www.codecademy.com/courses/python-beginner-en-cxMGf/1/2?curriculum_id=4f89dab3d788890003000096#

Why are there extra u' 's in my result?

Enter your hobby: sports
Enter your hobby: music
Enter your hobby: talking
[u'sports', u'music', u'talking']


I expected to have the following result

Enter your hobby: sports
Enter your hobby: music
Enter your hobby: talking
[sports, music, talking]

My code is given below

hobbies = []

# Add your code below!
for i in range(3):
    hobbies.append(raw_input("Enter your hobby: "))
print hobbies


#2

codecademy stores the result of raw_input as unicode, this should preferable be a string. use str() to cast to a string:

hobbies.append(str(raw_input("Enter your hobby: ")))

i guess its obvious that u stands for unicode :stuck_out_tongue:


#3

Yes it was the issue... now it works properly.. Thanks mate :+1:


#4