Why Does the Exercise Ask for One Hobby and Print it Three Times?


#1

why does the code academy solution ask for one hobby and then print it 3 times?


FAQ: Learn Python- Loops - For your hobbies
#2

Hi @jobseeker69,

Using a loop means you don’t have to write the code to get input and append it to the list for each hobby. If you wanted to ask for the user’s 5 favorite hobbies at some point, it would be easier to change the length of the range() than it would be to write more raw_input() lines for each additional hobby.


#3

I found this confusing too. I was expecting three inputs, rather than one input and three options.


#4

Generally, if you’re repeating an action several times, it’s best to put it in a loop. You’ll get used to doing that as you program more.