Bracket Square Notation


Replace this line with your code.


Been trying to get the third value of the array and an error keeps coming up...Make sure you use square bracket notation to pick out the third element.
my code is
print demo_array[2]

what could be the problem


Well, that looks right, but perhaps you're doing something else slightly different, renaming the array or some such. The conditions in the submission tests often don't exactly match the messages they give. (like assuming that if there is smoke then there is fire, bad assumptions)

If you give me a link to the exercise then I'm confident that I can find what it is really bothered by, but see if you can't find any such differences yourself just by comparing instructions to code/what you've done.



It is looking for:


In your code. That's what you showed me, which makes me think you ran something else.

So, what you can do next is
1) make sure you really ran that code, and that the above is somewhere in your code.
2) refresh page (probably won't help, but on the off-chance that it has your files confused)
3) post your exact and full code, in such a way that copying it and running it produces that error message (so that i get something to reproduce the problem with)

edit: actually I am able to reproduce with what you posted, brb with an edit
What you gave me:

print demo_array[2]

Triggers a different error from the one you described.
This new error is bothered by that you have changed the values, meaning that the third value is now a different one than what it looks for.


Changed the values in the array, still brings the error


But did you change them back to the same thing? Just changing them won't do, has to be the same, at least the third value does.

Suggestion: copy your code, click the Reset button, then paste your code back in below and decide what to keep.


Clicked the reset button and got the initial values. Thanks for the help


What could be the error of 1s command


No idea what you mean.