Quick question about len() and the index


#1

Neeeevermind. This question was answered in the lesson immediately after I asked it.

I just landed on an exercise that says:

if len(zoo_animals) > 3:
print "The first animal at the zoo is the " + zoo_animals[0]
print "The second animal at the zoo is the " + zoo_animals[1]
print "The third animal at the zoo is the " + zoo_animals[2]
print "The fourth animal at the zoo is the " + zoo_animals[3]

Does this list have a length of 3 because the index starts at zero or does it have a length of 4 because there are actually four items?


#2

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