For your hobbies


#1




The code is working and passes the lesson OK. I have added a print statement to check the appended hobbies list and it prints with a "u" before each item in the list. Does anyone know why this is?


hobbies = []

# Add your code below!
for i in range(3):
    hobby = raw_input("Name of hobby?")
    hobbies.append(hobby)

print hobbies


#2

yea, codecademy stores the input as unicode rather then a string.

simply cast to a string to get rid of the problem:

str(raw_input("something"))

#4

Lovely, thanks for the quick response :0)


#5

normally raw_input() gives you strings, for codecademy this isn't the case (as you experienced), if i ever figure out why, i will let you know, but normally you would get strings


#6

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