Python
Suppose a list called groceries has been initialized to [“milk”,”eggs”,”oranges”]. A programmer uses the list method sort() to arrange the items alphabetically. The sort() method
Question 1 options:
|
|||
|
|||
|
|||
|
Answer:
1) |
is a mutator method – it physically changes the order of the items in the list sort is muatr method that will sort the list items in ascending order. As a reault, sort method will change order as follows [“eggs”,”milk”,”oranges”] |
Python Suppose a list called groceries has been initialized to [“milk”,”eggs”,”oranges”]. A programmer uses the list...
Python program
- Write a Python program, in a file called sortList.py, which, given a list of names, sorts the names into alphabetical order. Use a one dimensional array to hold the list of names. To do the sorting use a simple sorting algorithm that repeatedly takes an element from the unsorted list and puts it in alphabetical order within the same list. Initially the entire list is unsorted. As each element is placed in alphabetical order, the elements in...
python 3 question Project Description Electronic gradebooks are used by instructors to store grades on individual assignments and to calculate students’ overall grades. Perhaps your instructor uses gradebook software to keep track of your grades. Some instructors like to calculate grades based on what is sometimes called a “total points” system. This is the simplest way to calculate grades. A student’s grade is the sum of the points earned on all assignments divided by the sum of the points available...