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
ludmilkaskok [199]
4 years ago
5

A teacher wants a program to give extra points to students who fail a test. Write a Python program to do the following: (a) Ask

the user to enter 5 test scores. Store the scores in a list. Display the list. (b) Copy all 5 test scores to another list. Use a loop to examine each test score in the new list. If the score is below 60, add 10 extra points to the score. Display the list. (c) Compare the old score and new score of each student. If the old score and new score are different, display the two scores.
Computers and Technology
1 answer:
Lorico [155]4 years ago
8 0

Answer:

Hi there! Please find the answer below.

Explanation:

The program below demonstrates how each of the requirements can be coded in a simple Python script. To copy the array, we can use the copy() method of the array. To calculate the diff, we can use a few different techniques, so I have implemented it using a loop over the arrays and just storing and displaying the difference in the 2 arrays.

new_string.py

def add_test_score(score):

 test_score.append(score);

contact_hash = {}

test_score = []

print("Enter 5 test scores: ");

for x in range(0, 5):

   input_string = input("Enter test score " + str(x + 1) + ": ")

   add_test_score(int(input_string));

print(test_score);

test_score_copy = test_score.copy();

for e in test_score_copy:

   if e < 60:

       test_score_copy[test_score_copy.index(e)] += 10;

diff = [];

for e in test_score:

   print(test_score[test_score.index(e)]);

   print(test_score_copy[test_score.index(e)]);

   if not test_score[test_score.index(e)] == test_score_copy[test_score.index(e)]:

       diff.append(e);

print(diff);

You might be interested in
Change the file name for index.html to index.php
Damm [24]

The PHP code is given below:

<h3>PHP code</h3>

if(isset($_REQUEST['login_btn'])){

       $email = filter_var(strtolower($_REQUEST['email']),FILTER_SANITIZE_EMAIL); //strtolower changes email to all lower case

       $password = strip_tags($_REQUEST['password']);

The remaining code is in the file attached.

 

Read more about PHP here:

brainly.com/question/27750672

#SPJ1

Download txt
4 0
2 years ago
Why is Data-Driven Analytics of interest to companies?
vivado [14]

Answer:

It allows companies to make definitive predictions about the future. It gives companies the ability to make informed decisions.

It helps Data Analysts shape an analytics problem from a business problem.

Explanation:

4 0
3 years ago
What effects will the different types of lighting produce on mountains?
bonufazy [111]
Once enough charge has been separated in a growing storm, a lightning flash can occur. These normally travel within or between clouds (abbreviated CC) or from cloud to ground (CG). Most storms produce more CC than CG flashes--about six times as many in tropical storms and two times as many in midlatitudes. Sometimes a flash will travel from cloud to air or simply occur within "clear" air.

Exactly what triggers flashes is still uncertain and an area of continued research. It seems that very concentrated electric fields (perhaps at the ends of pointed surfaces or single particles) are needed to accelerate charged particles, or ions. Once moving with sufficient energy, the ions appear to blaze a path toward opposite charge in cascading fashion.

3 0
3 years ago
______ are special characters that allow you to
yKpoI14uk [10]

Answer:

Defined Expression

Explanation:

This will be your answer

7 0
3 years ago
Aside from the smart cell phones used by a billion people, list and describe four
Pie
Gaming Computers- High processing speed and designed to be used for gaming.
Handheld Computers- The things that are being used by Billions of people. Firstly designed as an Internet Browser, now can be used in gaming and office purposes
Mainframe Computers- The large boxes (computers) that you see in server rooms. Designed to be used on processing large quantities of data on the same time.
Office Computers- The things you see in your office. Cheap computers that is undercut in processing speed, and designed to run Office applications.
that's​all I know. have a good day :)
5 0
3 years ago
Other questions:
  • When data are normalized, attributes in the table depend only on the secondary key?
    5·1 answer
  • Which of the following are incorrect safety precautions for equipment operators? A. Drive equipment or vehicles on grades or roa
    7·2 answers
  • ________ is a type of attack in which the attacker takes control of a session between two machines and masquerades as one of the
    5·1 answer
  • G Suite for Education offers which benefits to educators? (Select all that apply.) Select All Correct Responses Android apps ava
    10·1 answer
  • Technician A says that a cracked exhaust manifold can affect oxygen sensor operation. Technician B says that a clogged air filte
    7·1 answer
  • As long as users refer to files in the ____ directory, they can access the files without entering the absolute filename.
    10·1 answer
  • The __________ format is a proprietary file format defined by guidance software for use in its forensic tool to store hard drive
    15·1 answer
  • "You are working on a Debian distribution of Linux. You need to install a package, but you do not want to manually install all t
    8·1 answer
  • For the recursive method below, list the base case and the recursive statement, then show your work for solving a call to the re
    8·1 answer
  • 9. Differentiate between bolding and highlighting<br>text.<br>(2 marks)​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!