What's a negative index?
Answer / Jeetendra Kumar Pandey
In Python, when working with sequences like lists or strings, using a negative number as an index refers to counting from the end of the sequence. For example, `my_list[-1]` gets the last element in the list.
| Is This Answer Correct ? | 0 Yes | 0 No |
List of lists changes reflected across sublists unexpectedly?
Why python is faster than java?
What is the difference between `del` and `remove()` in Python?
Is true a keyword in python?
When would you use a list vs. A tuple vs. A set in python?
Explain the use of // operator in python?
What is a means by “tuple in python”?
How can you get the google cache age of any url or web page?
Explain static class variables in python?
What is subn() function?
What is numpy in python?
What does the map() function do?