7. Maintaining Order


#1



https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/4?curriculum_id=4f89dab3d788890003000096


Error messages:
"File "python", line 3
print duck_index = animals.index("duck")
^
SyntaxError: invalid syntax"
" Did you forget to assign a value to duck_index?"


What did I do wrong?


Replace this line with your code. 

animals = ["aardvark", "badger", "duck", "emu", "fennec fox"]

print duck_index = animals.index("duck")

animals.insert(duck_index, "corba")

print animals


#2

you can't print and assign a variable on the same line


#3

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