I want to create/call a function that first sorts a list of strings, and then then displays each item on the list, one per line in sorted & numerical order.
# This is an incomplete function
list = ["Hello", "Friend", "Apple", "Banana"]
def sorted()
sortedlist = sorted(list)
for i in sortedlist:
print (i)
The end result would look like this:
- Apple
- Banana
- Friend
- Hello
I suppose that once the list is sorted, then concat a 1, 2, 3 and so on for each item in the list, and then print?