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
Olegator [25]
3 years ago
8

Python: Write a program that generates 8 random scores (between 0 and 100), store them in an array,

Computers and Technology
1 answer:
maksim [4K]3 years ago
6 0

Answer:

<em>The program written in python is as follows;</em>

<em>Note that the program makes use of function named checkbest</em>

<em>Lines written bold are comments and are used to replace the explanation section</em>

<em></em>

#Program starts here

#This line imports the random module into the program

import random

#This line defines the function checkbest, with 2 parameters

def checkbest(score,best):

     #The following if condition implements the condition as stated in the

     #program requirement

     if score >= best- 10:

           grade = "A"

     elif score >= best - 20:

           grade = "B"

     elif score>= best - 30:

           grade = "C"

     elif score >= best - 40:

           grade = "D"

     else:

           grade = "F"

     #This line returns the letter grade depending on the above

     #conditions

     return "Grade: "+grade

#The main method starts here

#This line declares an empty list

array = []

#This line iterates from 1 to 8

for i in range(1,9):

     #This line generates a random integer between 0 and 100 (inclusive)

     score = random.randint(0,100)

     #This line inserts the generated score in the list

     array.append(score)

#This line sorts the list in ascending order

array.sort()

#This line gets the best score

best = array[7]

#This line iterates through the elements of the list

for i in range(0,8):

     #This line prints the current score

     print("Score: "+str(array[i]))

     #This line calls the function to print the corresponding letter grade

     print(checkbest(array[i], best))

     #This line prints an empty line

     print(" ")

#The program ends here

You might be interested in
How does a film establish the setting?
ololo11 [35]

Answer:

Establishing Shots are critical in a film. They clue the viewer where this next scene is about to take place. Each time the location of a scene shifts, a new establishing shot does exactly; what its name implies: it establishes where the story will now continue, and fiction writers need to do the same thing.

Explanation:

8 0
3 years ago
What is the configuration of a multimedia computer​
sertanlavr [38]

Answer:

) In computers and computer networks, a configuration often refers to the specific hardware and software details in terms of devices attached, capacity or capability, and exactly what the system is made up of.

Explanation:

hope it helps

3 0
4 years ago
Which. Option tilts the image both horizantly and vertically be degrees
Anit [1.1K]
Aaaaaaaeeeeeeeeiiiiiioooooouuuuuu
3 0
3 years ago
Is prediction harmful or not , why​
Marrrta [24]

Answer:

It's Not At All Because It's Just Like Yku Thinking Of Something

Explanation:

not at all

8 0
3 years ago
How to hack my neighboor wireless?​
guapka [62]

Answer:

 

How to Hack your Neighbor’s WiFi Password Using Tools

BY NEVIL PATELLEAVE A COMMENT

Getting a WiFi connection is a major concern once you are addicted to the web and mostly in the online world. When we hear the term hack, it strikes in our mind that it is the job of a high-end technology guy or a hacker. But to “hack WiFi password”, you don’t need to be a skilled technologist because even a non-technical guy can do it with some tricks and methods.

Most people have asked me the procedure to crack WiFi passwords, so today I am here with the solution and tricks for internet hack free WiFi from the major providers like AT&T, Comcast, and Xfinity.

 

wifi-password-hack

P.S. The WiFi password hacker tools are meant for fun/general purpose only and do not contain any functionality to attempt criminal acts. Therefore, you should be very cautious while operating them.

Wifi Hacker tools

(1) WiFi Hacker

WiFi Hacker is a simple and informal tool that makes hacking WiFi easy and safe without having required any technical knowledge. This software can crack WiFi passwords with some clicks and hack unlimited WiFi networks. WiFi Hacker gives you access to multiple offices or school wifi networks, including Comcast, AT&T, etc. which are equipped with tighter security. You can hack any locked password within minutes and anonymously because WiFi Hacker conceals your identity and personal information.

Explanation:

muwhahaha

7 0
3 years ago
Other questions:
  • What error, if any, is in the following code?
    11·1 answer
  • What piece of software tells the operating system how to use a specific hardware device?
    14·1 answer
  • What sugar is used in a DNA molecule​
    7·2 answers
  • Describe what is meant by the following:
    14·1 answer
  • What is the output of the following code? public class Test { public static void main(String[] args) { String s1 = new String("J
    9·1 answer
  • Who all likes fortnite
    15·2 answers
  • Do you think the current system of punishment in the United States works? Why? What would you change?
    13·1 answer
  • Grab the stniop or they will dissapear
    12·1 answer
  • Which line of code in this program is MOST likely to result in an error
    15·2 answers
  • Which group scope can be used to assign permissions to resources only in the domain in which the group is created
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!