sequences which is bettershallow cloning or deep cloningdepends on the application being written one is not necessarily better than the other there is an additional performance and memory hit for making deep clones but they are safer the type of application being developed will probably help determine which type of cloning is chosen should clones of objects be useful in the application item ordering now let us turn our attention to implementing the sort method on our pylist data type to sort sequence of itemsthe items in the sequence must be ordered in some way for instanceconsider class that is used to represent cartesian coordinates on plane we'll call the class point and it will contain an ( ,ypair we'll order the point objects by their directed distance from the axis in other wordsthey will be ordered by their -coordinates here is our point class for reasons that will be obvious soonour point class will inherit from rawturtle the point class class point(turtle rawturtle)def __init__(selfcanvasxy)super(__init__(canvascanvas register_shape("dot",(( , ),( , ),( , ),(- , ),(- , ),(- ,- ),( ,- )( ,- ))self shape("dot"self speed( self penup(self goto( , def __str__(self)return "("+str(self xcor())+","+str(self ycor())+") def __lt__(selfother)return self ycor(other ycor(objects of the point class have an ordering because we have defined the less than operator ( <by writing an __lt__ method in the class once definedthis less than operator orders all the elements of the class most of the built-in classes or types in python already have an implementation for the __lt__ method so we don' have to define this method for types like intfloatand str strings are compared lexicographically in python as they are in pretty much every language that supports string comparison lexicographic ordering means that strings are compared from left to right until one character is found to be different than the character at the corresponding position in the other string in other wordssorting sequence of strings means they will end up alphabetized like you would see in dictionary under some conditions lists are orderabletoo for lists to have an orderingthe elements at corresponding indices within the lists must be orderable consider these sample comparisons this copy belongs to 'acha