7. Maintaining Order



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


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


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