What have i done? apparently its an invalid syntax...? ducks


#1




File "python", line 2
duck_index = # Use index() to find "duck"
^
SyntaxError: invalid syntax

this is what it says when i put in the code. I'm not sure what i've done wrong


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

# Your code here!
animals.index("duck") == duck_index 
animals.insert(2, "cobra")

print animals # Observe what prints after the insert operation


#2

well, the comment:

# Use index() to find "duck"

is pretty self explaining what needs to be done on this line?

use index() to set the duck_index variable to the index of duck in the animal list

remove this line:

animals.index("duck") == duck_index

it looks quit poor.

now on this line:

duck_index =    # Use index() to find "duck"

try to get the duck_index, here is an example:

test = ["one","two","three"]
index_one = test.index("one") 
print index_one # will print zero

#3

nope still don't understand


#4

i expanded my answer


#5

................................
thanks
.................................


#6

omg i feel so stupid i didn't even see that!


#7

omg i feel so stupid i didn't even see that!


#8

code blindness. staring blind on the code, while it is staring you in the face, it can happen, good you solved it :slight_smile:


#11