Error in 15. Counting as you go


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

So I was messing around with the code in Lesson 15. Counting as you go in the loops section (mostly to help me see what does what, and what certain changes will do). I found that if you remove the enumerate code and its associated variable it will still be accepted as correct. Anyways I just thought this was interesting and wanted to share.

I hope I’ve formatted my post properly and whatnot, this is my first post :slight_smile:

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

choices = ['pizza', 'pasta', 'salad', 'nachos']

print 'Your choices are:'
for index in choices:
    print index

I forgot to include the output that is given, normally it should enumerate the list items, and do so starting at 1 instead of 0, to be considered correct.

Your choices are:
pizza
pasta
salad
nachos
None 

#2

It seems your profession wil be “Code tester”…

Just for the fun of it
https://stackoverflow.com/questions/604802/python-finding-an-element-in-an-array
and
https://stackoverflow.com/questions/176918/finding-the-index-of-an-item-given-a-list-containing-it-in-python


#3

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