Post

@PythonPr Answer: C) n
Python supports negative indexing.
-1 refers to the last element of a sequence.
"python" → p y t h o n
So:
a[-1] → n
Negative indexing is often used to access elements from the end of lists, strings, or tuples.
English

@PythonPr C. Negative indexes count backwards from the last element starting with -1, so a[-1] is n.
English

@PythonPr C) n last ellement/index in array (-2 whould be o as it goes in reverse ).
i always hate that it is -1 and not -0 considering arrays index starts at 0
English

@PythonPr C) n
a[0] = p
a[1] = y
a[2] = t
a[3] = h
a[4] = o
a[5] = n
a[-1] = n
a[-2] = o
a[-3] = h
a[-4] = t
a[-5] = y
a[-6] = p
Français

@PythonPr Indentation is key in Python, so I'm guessing the output will be an indentation error because the code isn't properly indented.
English



































