7/14 Maintaining Order


#1

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

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/python-beginner-en-pwmb1/1/4?curriculum_id=4f89dab3d788890003000096
<In what way does your code behave incorrectly? Include ALL error messages.>
I, to my knowledge, am doing everything correctly, but it keeps on saying “Oops, try again. Did you forget to assign a value to duck_index?” I don’t know how to solve this error message and it is beginning to drive me crazy.

Any help is appreciated.

Thanks!
<What do you expect to happen instead?>

```python

animals = [“aardvark”, “badger”, “duck”, “emu”, “fennec fox”]
duck_index = # Use index() to find “duck”

Your code here!

duck_index = animals.index(“duck”)
print(duck_index)
animals.insert(duck_index, “cobra”)

print animals # Observe what prints after the insert operation

<do not remove the three backticks above>

#2

Your second line is a syntax error. You have

duck_index =
but nothing is assigned to it. Delete that and the rest looks okay.

#3

I feel dumb now, haha.

Thank you so much!

Oh, by the way, how do you change your forum username on here?


#4

No problem! I’m not sure if you can change your username. I’d click your account and go to your preferences to see if you can change it there.


#5

I went in my preferences and changed it.

Thank you for helping me, Ropnog!

Can this thread be closed now?