zdwilliams1308
16.04.2020 •
Computers and Technology
Task1: #Define a function called show_students which takes 2 parameters students and message #Print out a message, and then the list of students #Next, put the students in alphabetical order and print them #Next, Put students in reverse alphabetical order and print them Example Output: Our students are currently in alphabetical order. - Aaron - Bernice - Cody Our students are now in reverse alphabetical order. - Cody - Bernice - Aaron
Solved
Show answers
More tips
- H Health and Medicine How to Tan in a Tanning Bed? Tips and Recommendations...
- W Work and Career What is the Most In-Demand Profession in the Modern World?...
- A Auto and Moto How Can Parking Sensors Help Drivers?...
- H Health and Medicine What is the Normal Blood Sugar Level in a Healthy Person?...
- F Food and Cooking Red Caviar: How to Choose the Best?...
- C Computers and Internet Clearing Cache: How to Speed Up Your Browser...
- S Style and Beauty How are artificial nails removed?...
- S Style and Beauty Secrets of Tying a Pareo: 5 Ways...
- F Food and Cooking Everything You Need to Know About Pasta...
Answers on questions: Computers and Technology
- C Computers and Technology How can you prove that the web server (iis) role is installed on the server?...
- B Biology How do the chromosomes in gametes produced during meiosis differ from those in somatic cells produced during mitosis...
- M Mathematics In circle L with m angle KLM=34 and KL = 6 units find area of sector KLM Round to the nearest hundredth...
- E English The student for his test and a good grade. Choose the words that create active voice. has been studying/hasstudies, receivesis studying/is hoping forwas studying/was hoping for...
- H Health is the percentage of muscle, fat, water and bones. a body composition b calcium...
- M Mathematics A tree that is 12 feet tall casts a shadow that is 9 feet long. At the same time a nearby stop sign casts a shadow that is 6 feet long. What is the height, h , of the stop sign?...
- W World Languages What is importance of hindi ?...
- M Mathematics ...5, ___, 29, The missing term is ___...
- M Mathematics 1. Determine if each of the following values is a solution to the given equation or inequality. (2) x/5 +3=7,x=20 (b) 3(x-7)+10 = 30, x=9 (c) 2x +5 13, x = 4 (d) -3p+554, p = 7...
- M Mathematics Given m GH =10 degrees and mEF = 73, Find m2J. I...
Ответ:
Explanation:
Firstly we declare a function that will take two inputs, message and student list (Line 1).
In the function, we first print the message and the original input student list (Line 2 - 3). Next, we use sort method to sort the input list and then output the sorted items from the list using a for loop (Line 5-10).
Next, we sort the list again by setting reverse = True and this will sort the list in descending order (Line 13). Again we use the similar way mentioned above to output the sorted items (in descending order) using a for loop (Line 14 -17)
We test the function using a sample student list (Line 18) and we shall get the output:
Welcome to new semester!
['Aaron', 'Bernice', 'Cody']
Our students are currently in alphabetical order
-Aaron-Bernice-Cody
Our students are currently in reverse alphabetical order
-Cody-Bernice-Aaron
Ответ:
I hope this helps!