7.2 What is wrong with this?


#1



Code: 
demo_array = [100, 200, 300, 400, 500]
print 
demo_array [2]

Displays:
300
After Save and Submit Code

Error Message:
Oops, try again. Make sure to use square bracket notation to print out the third element of demo_array.

As far as I can see I am getting the result I am expecting but I can not move on.

Any pointers?


#2

After some trial and error I changed the code to

demo_array = [100, 200, 300, 400, 500]
print demo_array[2]

And got the result 300nil

And the go ahead to move on!

Still don't know why I am getting the nil bit though...

Time to move on.....


#3

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