Exercise 2 About using sort(),reverse(),sorted() 

Run Settings
LanguagePython
Language Version
Run Command
# ERXERCISE # Think of at least five places in the world you’d like to visit? # Solution # Place Dar es salaam City Dar_city = ['Masaki','Oysterbay','Sea Cliff Hotel','Coco Bravo','Coco Beach'] # This is the Five place print(Dar_city) # list in its original order # Use sorted() to print your list in alphabetical order without modifying the actual list print(sorted(Dar_city)) # Output Brings the Chronogical-order Arrangment # Show that your List is still in its Original order by printing it. print(Dar_city) # Output Shows the Original of the List # Now we gonna used on sort of revers() Dar_city.sort(reverse=True) print(Dar_city) # Output Brings in Sort() Means arranged Chronogical-order But when encourage sort(reverse = True) Dar_city.sort() print(Dar_city) # Output Shows The Original of the List # Use reverse() to Change the order of your list. Show that the order Changed Dar_city.reverse() print(Dar_city) # Output Shows the reverse() of the list # Thy Question said reverse() Show that order changed but this Said to it;s Bacl to it;s Original Order Dar_city.sort(reverse=False) print(Dar_city) # Output brings that brings it's original Order because i Conducted on reverse = False so that indicated that Nothing Changes. # Use sort() To Change
Editor Settings
Theme
Key bindings
Full width
Lines