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
Fittoniya [83]
4 years ago
8

Write a program that extracts the last three items in the list sports and assigns it to the variable last. Make sure to write yo

ur code so that it works no matter how many items are in the list
Computers and Technology
1 answer:
defon4 years ago
7 0

Answer:

sports = ["football", "basketball", "volleyball", "baseball", "swimming"]

last = sports[-3:]

print(last)

Explanation:

*The code is in Python.

Create a list called sports

Create a variable called last and set it to the last three elements of the sports list using slicing

Print the last

You might be interested in
Which of the following operation is not performed by a mouse​
Stolb23 [73]

Explanation:

didn't evaluation into question

4 0
4 years ago
Advantages & Disadvantages of flow chart​
viktelen [127]

Answer:

Advantages of flow charts:

1. Communication where flowcharts are a more effective technique of explaining a system's rationale to all parties involved.

2. Efficient interpretation by using a flowchart, a problem can be investigated more effectively, resulting in lower costs and less time wasted.

3. Appropriate documentation such when program flowcharts serve as good documentary evidence, that is required for a variety of objectives, allowing things to run more smoothly.

4. Effective Coding where during the systems analysis and software development phases, the flowcharts serve as a guide or blueprint.

5. Practical Debug where the flowchart assists with the debugging process.

6. Efficient Program Maintenance by using a flowchart, it is simple to maintain an operational program. It allows the programmer to focus his efforts more effectively on that section.

Disadvantages of flow charts:

1. Manual traceability is required to ensure the accuracy of the flowchart drawn on paper.

2. Simple changes to the problem reasoning may necessitate a complete redo of the flowchart.

3. Displaying many branches and looping in flowchart is challenging.

4. When dealing with a complicated project or algorithm, the flowchart becomes very challenging and imprecise.

5. It can take some time to modify a flowchart.

3 0
2 years ago
Which of the following type of software application would open a txt file
kogti [31]
I think that it's A or C
3 0
3 years ago
Read 2 more answers
Create a function that should simulate a game involving the rolling of a standard six-sided dice between two players. The functi
Law Incorporation [45]

Answer:

import random

def roll_dice(r):

   score1 = 0

   score2 = 0

   for i in range(r):

       for j in range(5):

           score1 += random.randint(1,6)

           score2 += random.randint(1,6)

           

       avg1 = score1/5

       avg2 = score2/5

       

       if avg1 > avg2:

           print("Player1 won the " + str(i+1) + ". round ")

       elif avg1 < avg2:

           print("Player2 won the " + str(i+1) + ". round ")

       else:

           print("Tie")

       

       score1 = 0

       score2 = 0

           

roll_dice(3)

Explanation:

Import the random module

Create a function called roll_dice that takes one parameter r

Initialize two scores as 0 for the players

Create a nested for loop. The outer loop will simulate the rounds and inner loop will simulate the each roll.

Inside the inner loop which iterates five times, generate random numbers for two players and add these numbers to their score.

When the inner loop is done, calculate the average score of the players. If the first average is greater, player1 wins the round. If the second average is greater, player2 wins the round. Otherwise, it is a tie. Also, set the scores to zero so that they start again.

Call the function with parameter 3, simulating 3 rounds

4 0
3 years ago
What were the primary purposes of the first digital
Vesnalui [34]

Answer:

It was designed to serve the science and military departmemt

Explanation:

It surely could not be designed for the purpose of instagram

3 0
3 years ago
Other questions:
  • The integer variables first and last have been declared and assigned values (with last &gt;= first). Allocate an integer array t
    10·1 answer
  • An Internet connection problem for customers is found to be outside a carrier's regional office. As a result, which area needs t
    9·1 answer
  • Hackers often argue that hacking is for the good of all people because it points out flaws in computer systems. do you agree wit
    6·1 answer
  • Craig wants to create a computing infrastructure that will allow developers within his company to build applications on a primar
    9·1 answer
  • On the Loan worksheet in cell c9 enter PMT function to calculate the monthly payment for the Altamonte springs 2018 facilities l
    11·1 answer
  • Ifdjgidfpojcjdizchnllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllsssssssssssssssssssssssssss
    13·2 answers
  • Which SCSI standard allows for the technique known as “hot swapping”? Ultra SCSI Original SCSI Serial SCSI Fast-Wide SCSI
    5·1 answer
  • Select the true statement about HTML. HTML is a language that is used to create Web pages. HTML tags tell a web browser when to
    7·2 answers
  • What is the best way of farming exotics in destiny?
    12·2 answers
  • Based on three scores that the user inputs, display the average of the score and the letter grade that is assigned fort he test
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!