Why am I getting a syntax error?


#1

hobbies = []

for i in range(3):
hobby = int(raw_input("What is your hobbie")
hobbies.append(hobby)

Keep on getting a syntax error in line 5???
hobbies.append(hobby)

help please


#2

First how to format code so we can see the indentaion.
1) copy and paste your code
2) highligt/select your whole code
3) then look for this </> and press it.
or
simply press ctrl + shift + c and past the code inside the highlighted area.
Now then first you are mising ")" in hobby variable at the end.
now go to the line 3 at the beginning and press tab that should fix the problem.


#3

maybe because you're creating hobby 3 times, try it like this

hobbies = []

# Add your code below!
for i in range(3):
    hobbies.append(str(raw_input("What's your Hobbie?")))

print hobbies

#4

thanks for the help, realized that I was converting the string input into an integer input, once that was fixed, all worked just fine.