Why it shows "u"?


#1



hobbies = []

# Add your code below!


for hobby in range(3) :
    hobby = raw_input("your hobby? :")
    hobbies.append(hobby)

print hobbies


#2

raw_input stored the input as unicode data type, so the u is from (of?) unicode.

You can just cast it to a string:

hobby = str(raw_input("your hobby? :"))

then the u should be gone


#3

thx for the reply.

well, would you explain about "the input as unicode data type, so the u is from (of?) unicode." this statement more?

I don't get the idea about unicode.


#4

unicode is a dataype, just like integers, strings and Boolean's. I know little of unicode to be honest, but there is wikipedia to help us out


#5

thanks for the reply....got rid of 'u' from my output. :slight_smile:


#6