16 lines
471 B
Python
16 lines
471 B
Python
# list as an input parameter
|
|
def myFunction4(listParameter):
|
|
for listItem in listParameter:
|
|
print("\tlistParameter item: ",listItem)
|
|
myList = listParameter
|
|
myList.sort()
|
|
return( myList ) # Return a list
|
|
|
|
# ======================== Main Program =============================
|
|
|
|
fruits = ['Mango','Banana','Cherry', 'Apples']
|
|
print("\n Starting list: ",fruits)
|
|
print("\n")
|
|
|
|
sortedFruits = myFunction4(fruits)
|
|
print("\n Returned list: ",sortedFruits)
|