For your hobbies


This is my code:

hobbies = []

Add your code below!

for i in range(3):
hobby = raw_input("Enter a hobby: ")
print hobbies

And this is my output:

Enter a hobby: Soccer
Enter a hobby: Coding
Enter a hobby: Dancing
[u’Soccer’, u’Coding’, u’Dancing’]

Why does a ‘u’ precede every element in the list hobbies?


cause raw_input stores the result as unicode:


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