Code output issue


#1

hobbies = []

Add your code below!

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

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

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


#2

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: "))
  hobbies.append(hobby)
  
print hobbies
Enter a hobby: music
Enter a hobby: reading
Enter a hobby: coding
['music', 'reading', 'coding']

Tested in Chrome on Windows 7.


#4

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