1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jeyben [28]
3 years ago
14

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
Computers and Technology
1 answer:
k0ka [10]3 years ago
6 0

Answer:

  1. def show_students(message, sList):
  2.    print(message)
  3.    print(sList)
  4.    print("Our students are currently in alphabetical order")
  5.    sList.sort()
  6.    output = ""
  7.    for student in sList:
  8.        output += "-" + student
  9.    print(output)
  10.    print("Our students are currently in reverse alphabetical order")
  11.    sList.sort(reverse=True)
  12.    output = ""
  13.    for student in sList:
  14.        output += "-" + student
  15.    print(output)  
  16. show_students("Welcome to new semester!", ["Aaron","Bernice", "Cody"])

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

You might be interested in
Lindsey also needs to calculate the commissions earned each month. If the company earns $200,000 or more in a month, the commiss
lutik1710 [3]

Answer:

I have created and attached an image with example values for this question.

First we'll learn the IF function syntax:

IF(logical_test, value_if_true, [value_if_false])

Where

logical_test is the decision making comparison

value_if_true is the result to return when TRUE

value_if_false is the result to return when FALSE

We assume that cells B10 to G10 contain the Total Sales for January to June. And cells B17 to G17 contain the Commissions for January to June.

a.

The formula to use in cell B17 is:

<em>=IF(B10>=200000;True;False)</em>

<em />

b.

The formula to use in cell B17 is:

<em>=IF(B10>=200000;B10*0.35;False)</em>

<em />

c.

The formula to use in cell B17 is:

<em>=IF(B10>=200000;B10*0.35;B10*0.27)</em>

<em />

d.

To copy the formula in B17 to C17:G17, you can just copy and paste or select cell B17 and drag from the black square on the bottom right of the cell.

8 0
3 years ago
Read 2 more answers
When you are creating a game you plan to sell online and you need to implement art:
Lilit [14]

Answer:

you can download images that the creator has given permission to use freely.

Explanation:

5 0
3 years ago
Read 2 more answers
onsider the following program: Peform a total of six exercises. Select one exercise from each of the following areas: hips and l
Leviafan [203]

Answer:

Beginner

Explanation:

A program like this is ideal for a beginning exerciser due to the high number of repetitions and the sets are not much.

Cheers

3 0
3 years ago
Help me please!! Brainliest for answering this question.
cluponka [151]

That sounds like a reader's activity level

8 0
3 years ago
Why are random-access files preferable to sequential-access files in performance- oriented situations?
Flauer [41]

Answer: Random-access files are those file types which have the capability of being accessed anytime directly without the requirement of any other support or file.The reading and writing of data can be done from anywhere and any point of time.

Sequential-access files are those files which can be accessed only in sequential manner for the writing and reading purpose.The sequence followed is from beginning to end of file.

Performance-oriented situation requires those files in working that can perform with the superior ability to carry out the job and can be assessed easily as per demand.Thus, these features are performed by random access file as compared with sequential-access files.So, random -access files are more preferred .

3 0
3 years ago
Other questions:
  • A Windows user called the help desk to request that her local user account password be reset on her computer. The help desk tech
    5·1 answer
  • Two electronics technicians are measuring electrical quantities in circuits. Technician A says that copper, glass, porcelain, an
    13·2 answers
  • Match these items. 1 . Naturalization Act stated that a foreigner had to live in the United States fourteen years to become a ci
    5·1 answer
  • For almost all networks today, including the internet, the communication protocol used is called ____.
    15·1 answer
  • Computers are used to store, retrieve, and _____ data. manipulate mechanize memorize operate
    12·1 answer
  • Which of the following does not use a Graphic User Interface?
    14·1 answer
  • What is an Operating system??
    5·1 answer
  • Full form of computer
    12·1 answer
  • When a called function completes its task, it normally:_________a. logs its results b. terminates program execution normally c.
    5·2 answers
  • An array called numbers contains 35 valid integer numbers. Determine and display how many of these values are greater than the a
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!