Skip to main content

Posts

Showing posts from September 9, 2020

Index in Python

  Generally, we add elements in lists, tuples and we delete items, insert elements etc but how can we do that, how can we access a particular element, this is done by using index number. PDF FOR  INDEX IN PYTHON   Ø   Index numbers are nothing but numbers which are given to elements in a list or tuple or array etc to access them. Ø   Index number starts with zero and ends with one less than the given number but For example  List = [1,5,8,13,24,31] 0  1  2  3   4   5 Ø   Each index refers to one element, as we know here the elements in the list are 6 but the maximum index will be 5 this is because index starts with zero so maximum index will always be one less than the length of list or tuple or array etc. ADVANTAGES in Python: Ø   It makes our work easier like we can easily delete the element we want to delete by just using its index number. Ø   There are lot of ways to print elements using index values. Ø   By directly using that element in square brackets For exampl

Contact form

Name

Email *

Message *