Ask Question
Today, 08:08

Define a Python function named sortIt with 1 parameter. This parameter will be a list. Your function should use list's built-in function to organize its entries from smallest to largest. Because the built-in function reorders a list's entries "in place", your function must not return anything.

+3
Answers (1)
  1. Today, 11:10
    0
    Following are the code to this question:

    def sortIt (l) : # defining a method sortIt

    l. sort () # Using Sort method

    return l #return list value

    l = [55,66,23,10,12,4,90] #defining a list and assign a value

    print (sortIt (l)) #call the method and print its return value

    Output:

    [4, 10, 12, 23, 55, 66, 90]

    Explanation:

    The description of the above python code can be given as follows:

    In the first step, A method "sortIt" is declared, that accepts a list in its parameter, inside the method an inbuilt method, that is "sort () " is used. This method is used to arrange all the data into ascending order. This method takes a list that is "l" and convert all value ascending order, and return its value. In the last step, the list "l" is defined, that stores number and pass into the method, and print is the return value.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Define a Python function named sortIt with 1 parameter. This parameter will be a list. Your function should use list's built-in function to ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers