the positional list abstract data type to provide for general abstraction of sequence of elements with the ability to identify the location of an elementwe define positional list adt as well as simpler position abstract data type to describe location within list position acts as marker or token within the broader positional list position is unaffected by changes elsewhere in listthe only way in which position becomes invalid is if an explicit command is issued to delete it position instance is simple objectsupporting only the following methodp element)return the element stored at position in the context of the positional list adtpositions serve as parameters to some methods and as return values from other methods in describing the behaviors of positional listwe being by presenting the accessor methods supported by list ll first)return the position of the first element of lor none if is empty last)return the position of the last element of lor none if is empty before( )return the position of immediately before position por none if is the first position after( )return the position of immediately after position por none if is the last position is empty)return true if list does not contain any elements len( )return the number of elements in the list iter( )return forward iterator for the elements of the list see section for discussion of iterators in python the positional list adt also includes the following update methodsl add first( )insert new element at the front of lreturning the position of the new element add last( )insert new element at the back of lreturning the position of the new element add before(pe)insert new element just before position in lreturning the position of the new element add after(pe)insert new element just after position in lreturning the position of the new element replace(pe)replace the element at position with element ereturning the element formerly at position delete( )remove and return the element at position in linvalidating the position for those methods of the adt that accept position as parameteran error occurs if is not valid position for list