given a list, such as:
programming_languages = ['Python', 'Perl', 'R', 'Ruby']
What are the rules for using double square brackets [] ?
What I mean is if I try accessing programming_languages[2][0]
or programming_languages[3][0]
or programming_languages[-1][-4]
for example, I'll get the element 'R'.
Thanks in advance for the help on clearing this up for me!
Edit: For some reason I did not realise the 'R' I get while accessing programming_languages[3][0]
or programming_languages[-1][-4]
is actually the 1st character of the 4th element in the list, and NOT the 2nd element 'R'.
Thanks for the answers below!