10. For your hobbies


#1



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


hobby: z
hobby:
hobby: c
['q', 'l', u'z', u'', u'c']
None


Why is there a 'u' ?
why not ['q',...'z', '', 'c']


Replace this line with your code. 
hobbies = ['q', 'l']

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


#2

raw_input stores the data as unicode, so the u is of unicode, use str() to cast the unicode to a string


#3

this is the code that I used and it worked correctly. it gives the same exact response but it's a little bit of a shortcut i guess? not sure if it would work in every instance.

hobbies = []

Add your code below!

for i in range(3):
hobbies.append(str(raw_input("Hobby: ")))
print hobbies


#4

Your code should work fine always, it is just written a bit shorter, nicely done


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.