abstract data types mybag bag(mybag add mybag add mybag add mybag add mybag add value intinput("guess value contained in the bag "if value in mybagprint"the bag contains the value"value else print"the bag does not contain the value"value nextconsider the checkdates py sample program from the previous section where we extracted birth dates from the user and determined which ones were for individuals who were at least years of age suppose we want to keep the collection of birth dates for later use it wouldn' make sense to require the user to re-enter the dates multiple times insteadwe can store the birth dates in bag as they are entered and access them lateras many times as needed the bag adt is perfect container for storing objects when the position or order of specific item does not matter the following is new version of the main routine for our birth date checking program from listing #pgmcheckdates py (modified main(from checkdates pyfrom linearbag import bag from date import date def main()bornbefore date bag bag(extract dates from the user and place them in the bag date promptandextractdate(while date is not none bag adddate date promptandextractdate(iterate over the bag and check the age for date in bag if date <bornbefore print"is at least years of age"date why bag adtyou may be wonderingwhy do we need the bag adt when we could simply use the list to store the itemsfor small program and small collection of datausing list would be appropriate when working with large programs and multiple team membershoweverabstract data types provide several advantages as described earlier in section by working with the abstraction of bagwe canafocus on solving the problem at hand instead of worrying about the