you may need to sort items in reverse order at times to accomplish this taskyou use the reverse(function the function must appear on separate line so the previous example would look like this if you wanted to sort the colors in reverse ordercolors ["red""orange""yellow""green""blue"for item in colorsprint(itemend="print(colors sort(colors reverse(for item in colorsprint(itemend="print(working with the counter object sometimes you have data source and you simply need to know how often things happen (such as the appearance of certain item in the listwhen you have short listyou can simply count the items howeverwhen you have really long listit' nearly impossible to get an accurate count for exampleconsider what it would take if you had really long novel like war and peace in list and wanted to know the frequency of the words the novel used the task would be impossible without computer the counter object lets you count items quickly in additionit' incredibly easy to use this book shows the counter object in use number of timesbut this shows how to use it specifically with lists the example in this section creates list with repetitive elements and then counts how many times those elements actually appear this example also appears with the downloadable source code as usecounterwithlist py open python file window you see an editor in which you can type the example code type the following code into the window -pressing enter after each line