हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा १२

How will you access the list elements in reverse order?

Advertisements
Advertisements

प्रश्न

How will you access the list elements in reverse order?

टिप्पणी लिखिए
Advertisements

उत्तर

  • Python enables reverse or negative indexing for the list elements.
  • Thus, python lists indexes in the opposite order.
  • The python sets -1 as the index value for the last element in the list and -2 for the preceding element and so on. This is called Reverse Indexing.

Example: Age = [15,20,29,45,60]

Age 15 20 29 45 60
Positive index 0 1 2 3 4
Negative index -5 -4 -3 -2 -1
shaalaa.com
Introduction to List
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 9: Lists, Tuples, Sets and Dictionary - Evaluation [पृष्ठ १६८]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 12 TN Board
अध्याय 9 Lists, Tuples, Sets and Dictionary
Evaluation | Q 2. | पृष्ठ १६८
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×