Weird append


#1



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


the list is printed out to be [u'wer', u'no', u'ne'], with the extra u'' while wer, no, ne are the inputs. however the u is removed if i were to put hob = str(raw_input("What's your hobby?")) instead. why does this happen?? and also how can i remove the apostrophes in the list?


hobbies = []

for i in range(3):
    hob = raw_input("What's your hobby?")
    hobbies.append(hob)
print hobbies


#2

please read this topic:

to get rid of the apostrophes in the list, use a for loop to print each item in list


#3

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