Code output issue


hobbies =

Add your code below!

for i in range(3):
hobby= raw_input(“Enter your hobby here:”)

Enter your hobby here:singing
Enter your hobby here:Enter your hobby here:

Defect Issue: Why its not asking for input at 2nd iteration.


I just tried using this slightly modified code and it works as expected and is accepted.

hobbies = []

# Add your code below!
for n in range(3):
  hobby = str(raw_input("Enter a hobby: "))
print hobbies
Enter a hobby: music
Enter a hobby: reading
Enter a hobby: coding
['music', 'reading', 'coding']

Tested in Chrome on Windows 7.


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