Python Lists and Events: Write a program that generates 8 random scores (between 0 and 100), store them in an array, finds the best score, and then assigns grades based on the following scheme (use loops wherever possible): Grade is A if score >= best – 10 Grade is B if score >= best – 20 Grade is C if score >= best – 30 Grade is D if score >= best – 40 Grade is F otherwise.

Answers

Answer 1

Answer:

import random

scores = []

for i in range(8):

   score = random.randint(0,100)

   scores.append(score)

best_score = max(scores)

letter_grade = ""

for s in scores:

   if s >= best_score - 10:

       letter_grade = "A"

   elif s >= best_score - 20:

       letter_grade = "B"

   elif s >= best_score - 30:

       letter_grade = "C"

   elif s >= best_score - 40:

       letter_grade = "D"

   else:

       letter_grade = "F"

   

   print(letter_grade)

Explanation:

Import the random module

Create an empty list to hold the scores

Create a for loop that iterates 8 times. Inside the loop, create 8 random scores and put them in the scores

When the loop is done, find the best_score using max method

Create another for loop that iterates through the scores. Check each score and set the letter_grade depending on the given conditions.


Related Questions

Publication of flaws in encryption used for copy protection is a potential violation of: A. HIPAA B. U.S. Commerce Department regulations C. DMCA D. National Security Agency regulations

Answers

Answer:

Option C (DMCA) would be the correct choice.

Explanation:

DMCA is designed to govern electronic channels and tackle the problems the online revolution confronts regarding copyright. DMCA's mission seems to be to accommodate the rights of intellectual property producers and investors and investigate anything other than a copyrighted material that really occurs throughout the digital environment.

The other given choice are not related to the given content. So that option C is the right one.

A data set includes data from 500 random tornadoes. The display from technology available below results from using the tornado lengths​ (miles) to test the claim that the mean tornado length is greater than 2.2 miles. Use a 0.05 significance level. Identify the null and alternative​ hypothesis, test​ statistic, P-value, and state the final conclusion that addresses the original claim. LOADING... Click the icon to view the display from technology. What are the null and alternative​ hypotheses

Answers

Answer:

The answer is:

[tex]H_0:\mu=2.2\\H_1:\mu> 2.2[/tex]

Explanation:

[tex]H_0:\mu=2.2\\H_1:\mu> 2.2[/tex]

The test value of statistic t= [tex]\frac{\bar x-\mu}{\frac{s}{\sqrt{n}}}[/tex]

                                               [tex]=\frac{2.31688-2.2}{0.206915}\\\\=0.56[/tex]

The value of P = P(T>0.56)

                          =1-P(T<0.56)

                          =1-0.712

                          =0.288

Since the P value exceeds its mean value (0.288>0.05), the null assumption must not be rejected.  Don't ignore H0. This assertion, it mean length of the tornado is greater than 2.2 miles also isn't backed by enough evidence.

The parallax perspective says that objects that are close up appear to move __________ than far away objects.

A. More smoothly
B. More randomly
C. Slower
D. Faster ​

Answers

Answer:

It appears to move faster.

what is a type of system software that allows a user to perform maintenance type tasks​

Answers

Answer:

Computer

Explanation:

The type of system software that allows a user to perform maintenance-type tasks​ is a computer.

A computer has many programs and operating systems.

Write a program segment with a do-while loop that displays whether a user-entered integer is even or odd. The code should then ask the user if he or she wants to test another number. The loop should repeat as long as the user enters 'Y' or 'y' . Use a logical OR operator in the do-while loop test expression

Answers

Answer:

Following is the program in C++ program

#include<iostream> // header file

using namespace std; // namespace  

int main() // main function  

{

int num1 = 0; // variable declaration  

char test;// variable declaration  

do

{

cout << " Enter the number: ";

cin >> num1; //Read the input by the user  

if (num1 % 2 == 0) // check the condition of even

cout << " number is even.\n";

else // check the condition of odd

cout << "Number is odd.\n";

cout << " Do you wanted the another test of number (y/n)? ";

cin >> test; //Read the input by user

} while (test == 'y' || test == 'Y'); //terating the loop

return 0;    

}

Output:

Enter the number:45

number is even.

Do you wanted the another test of number (y/n) Y

Enter the number:5

Number is odd.

Do you wanted the another test of number (y/n) n

Explanation:

Following are the description of program

Declared a variable "num1" as integer type and initialized as 0 to them Declared a variable "test" as char type .After that iterating the do -while loop .Read the value by the user in the "num1" variable .Check the condition of even and odd by using % operator .Read the value of test by the user .If the user enter Y or y then loop again executing otherwise not .

Which of the following answers refers to a system containing mappings of domain names to various types of data, such as numerical IP addresses?

Answers

Answer:

DNS or Domain Name System

Explanation:

You can query a DNS server with a domain name to get an IP address.

Which statement is the best description of what a macro can do in Excel 2016? It is a type of formatting users can apply to enlarge the worksheet area. It is a file type that a user can save a workbook as. It is a series of instructions contained in one command that users can apply to automate complex and/or repetitive tasks. It is a recording function that allows you to save worksheets, audio recordings, and videos that are displayed on the screen.

Answers

Answer: It is a series of instructions contained in one command that users can apply to automate complex and/or repetitive tasks

One example would be a macro that goes through a list of numbers and highlights which are duplicates. Say you had the list {1,2,3,3,4,4,4,5}. You could use one color to highlight both 3 and 4 as they repeat themselves. Or you could use different colors to show the different values. With a small list, you could highlight by hand. However, macros are more efficient with larger lists.

Answer:

It is a series of instructions contained in one command that users can execute to automate complex and/or repetitive tasks.

Explanation:

edge 2022

a force of 50n acts on a body of mass 5kg. calculate acceleration produced .​

Answers

Answer:

Force = 50n

mass = 5kg

Force = m * acc

50 = 5 * A

A = 50/5

A = 10 m/s^2

HOPE IT HELPS!!!

Explanation:

Whoever answers FRIST and it has to be correct so if you don’t know don’t waste your time pls. Anyway whoever answer frist I will give you brainliest and some of my points Which type of photography would you use if you wanted to photograph a fly?

Answers

Answer:

I think Ariel photography

Explanation:

I’m not sure, but I think so

Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive. After the loop terminates, it prints out, on a line by itself, the sum of all the even integers read. Declare any variables that are needed. ASSUME the availability of a variable, stdin, that references a Scanner object associated with standard input

Answers

Answer:

Written in Java Programming Language

import java.util.Scanner;

public class Assign{

   public static void main(String [] args)    {

   Scanner stdin = new Scanner(System.in);

   int num,sum=0;

   System.out.println("Start Inputs: ");

   num = stdin.nextInt();

   while (num>=0) {

       if(num%2== 0)

       {

       sum+=num;    

       }      

       num = stdin.nextInt();

   }

   System.out.print("Sum of even numbers: "+sum);

   

   }

}

Explanation:

I'll start my explanation from line 4

This line initializes Scanner object stdin

Scanner stdin = new Scanner(System.in);

This line declares necessary variables and initializes sum to 0

   int num,sum=0;

This line prompts user for inputs

   System.out.println("Start Inputs: ");

This line reads user inputs

   num = stdin.nextInt();

This line checks is user input is not negative (It's a loop that will be repeated continually until a negative number is inputted)

   while (num>=0) {

This line checks if user input is an even number

       if(num%2== 0)

       {

If the above condition is true, this line calculates the sum of even numbers

       sum+=num;    

       }      

This line prepares the user for next input

       num = stdin.nextInt();

   }

This line prints the calculated sum of even number; If no even number is inputted, the sum will be 0

   System.out.print("Sum of even numbers: "+sum);

While working on an investigation, a colleague hands you a list of file creation and access times taken from a compromised workstation. To match the times with file access and creation times from other systems, what do you need to account for

Answers

Answer:

Record time offsets.

Explanation:

In this scenario, to match the times with file access and creation times from other systems, you will need to account for time offsets.

The time offset refers to the time stamp associated with different processes or tasks on a computer in nanoseconds through the operating system.

Since you've been handed a list of file creation and access times taken from a compromised workstation by your colleague, you'll need to match respectively the time the file was created to the time it was accessed by an unauthorized user.

Additionally, the time stamp varies depending on the operating system being used;

- For windows operating system, it uses a 64 bit time stamp.

- For Linux or Unix, it uses a 32 bit time stamp.

Which is not a proper statement?

Answers

Answer:

leftisBlocked()

Explanation:

Answer: leftIsBlocked()

Hope it helps <3

Assume you are given an int variable named nPositive and a two-dimensional array of ints that has been created and assigned to a2d. Write some statements that compute the number of all the elements in the entire two-dimensional array that are greater than zero and assign the value to nPositive.

Answers

Answer:

public class Main

{

public static void main(String[] args) {

    int nPositive = 0;

    int[][] a2d = {{-7,28, 92}, {0,11,-55}, {109, -25, -733}};

 for (int i = 0; i < a2d.length; i++) {

                  for(int j = 0; j < a2d[i].length; j++) {

         if(a2d[i][j] > 0){

             nPositive++;

                       }

                  }

 }

 System.out.println(nPositive);

}

}

Explanation:

*The code is in Java.

Initialize the nPositive as 0

Initialize a two dimensional array called a2d

Create a nested for loop to iterate through the array. If an element is greater than 0, increment the nPositive by 1

When the loop is done, print the nPositive

Answer:

const a2d =  [[7,28, 92], [0,11,-55], [109, -25, -733]];

let nPositive = a2d.reduce((a,c) => a + c.filter(n => n>0).length, 0);

console.log(nPositive);

Explanation:

Just for fun, I want to share the solution in javascript when using the powerful list operations. It is worthwhile learning to understand function expressions and the very common map(), reduce() and filter() primitives!

32.
To give an existing document a different name
A. retype and give it another name,
B. use the save command
C. use the same as command
D. use windows explorer to copy.

Answers

Answer:

B.

Explanation:

If you are trying to save an existing document you would use the save command and you will be prompted if you want to rename it to what ever you wish

Hope this helps :)

What is the best way to improve the following code fragment? if ((counter % 10) == 0) { System.out.println("Counter is divisible by ten: " + counter); counter++; } else { System.out.println("Counter is not divisible by ten: " + counter); counter++; }

Answers

Answer:

The correct code to the given question is

if ((counter % 10) == 0)  // check the condition

{

System.out.println("Counter is divisible by ten: " + counter);  // display

}

else  // check the condition

{

System.out.println("Counter is not divisible by ten: "  +counter); // display the //value

}

counter++; // increment the value of counter

Explanation:

Following are the description of code

In the given question we have to check the condition that the given number is divisible by 10 or not .In the if block if the number is divisible by 10 then it print the value of number and increment the value of counter .In the else block if the number is not divisible by 10 then it print the value of number and increment the value of counter .It means the value of counter is increases in the if block as well as in the else block .So we have to remove the counter statement from there and place outside the if and else block .

An employee sets up Apache HTTP Server. He types 127.0.0.1 in the browser to check that the content is there. What is the next step in the setup process?

Answers

Answer:

Set up DNS so the server can be accessed through the Internet

Explanation:

If an employee establishes the HTTP server for Apache. In the browser, he types 127.0.0.1 to verify whether the content is visible or not

So by considering this, the next step in the setup process is to establish the DNS as after that, employees will need to provide the server name to the IP address, i.e. where the server exists on the internet. In addition, to do so, the server name must be in DNS.

Hence, the first option is correct

Your question is lacking the necessary answer options, so I will be adding them here:

A. Set up DNS so the server can be accessed through the Internet.

B. Install CUPS.

C. Assign a static IP address.

D. Nothing. The web server is good to go.

So, given your question, what is the next step in the setup process when setting up an Apache HTTP Server, the best option to answer it would be: A. Set up DNS so the server can be accessed through the Internet.

A server can be defined as a specialized computer system that is designed and configured to provide specific services for its end users (clients) on a request basis. A typical example of a server is a web server.

A web server is a type of computer that run websites and distribute web pages as they are being requested over the Internet by end users (clients).

Basically, when an end user (client) request for a website by adding or typing the uniform resource locator (URL) on the address bar of a web browser; a request is sent to the Internet to view the corresponding web pages (website) associated with that particular address (domain name).

An Apache HTTP Server is a freely-available and open source web server software designed and developed to avail end users the ability to deploy their websites on the world wide web (WWW) or Internet.

In this scenario, an employee sets up an Apache HTTP Server and types 127.0.0.1 in the web browser to check that the content is there. Thus, the next step in the setup process would be to set up a domain name system (DNS) so the server can be accessed by its users through the Internet.

In conclusion, the employee should set up a domain name system (DNS) in order to make the Apache HTTP Server accessible to end users through the Internet.

Find more information here: https://brainly.com/question/19341088

Which is the right way to give comment if you are using Internet explorer as the browser? a) <!-- My First Webpage --> b) <comment> My First Webpage </comment>

Answers

Answer:

(a) <!-- My First Webpage -->

Explanation:

Comments in programming languages are chunks of texts, written as part of program code, that are not executed as actual code but rather used for making the program code easily readable and understandable. They allow programmers to explain certain lines of a program code.

Every programming language has its own way of representing comments. In HTML - HyperText Markup Language - comments are written between the following tags :

<!--

and

-->

For example, to put the text "My comment goes here" in a comment, we write:

<!-- My comment goes here -->

From the question, the text to be put is:  "My First Webpage". Therefore, we write;

<!-- My First Webpage -->

Roger is getting a $5,000 loan. Which option will allow Roger to pay off the loan and keep his payments under $100?

Answers

No roger will not be able to do that

What is Relational Computerized Database

Answers

Answer:

Relational computerized database uses tables and columns to store data. each table is composed of records and each record is tied to an attribute containing a unique value. This helps the user use the data base by search query and gives the opportunity to build large and complex data bases

Which of the following statements about an inner class is true? An inner class is used for a utility class that should be visible elsewhere in the program. An inner class that is defined inside a method is publicly accessible. An inner class that is defined inside a method is not publicly accessible. An inner class that is defined inside an enclosing class but outside of its methods is not available to all methods of the enclosing class.

Answers

Answer:

(c) An inner class that is defined inside a method is not publicly accessible.

Explanation:

In programming languages such as Java, inner class (also called nested class) basically means a class inside another class or interface. The following are a few things to note about an inner class

i. Inner classes are used to group classes logically so that they are easy to use and maintained.

ii. An inner class defined inside a method of an enclosing class is not publicly accessible. They are called method local inner class

iii. An inner class that is defined inside an enclosing class but outside of its methods are available to all methods of the enclosing class

iv. An inner class has access to members, including private members, of its enclosing class.

explain any five features of a spread sheet application​

Answers

The basic features of a spreadsheet program are :

Grids, Rows & Columns. A spreadsheet consists of a grid of columns and rows.

Functions. Functions are used in the Spreadsheet software to evaluate values and perform different kinds of operations.

Formulas.

Commands.

Text Manipulation.

Printing.

Title Bar.

Menu Bar

Hope u understood!

pls mark me brainliest!

#staysafestayhome

You work for a public relations (PR) firm and communicate regularly with the internal team and the clients on a PR campaign. You need to quickly send and receive professional messages that may contain text files and short media. These messages need to be accessible at any time of the day and in different time zones, and they should be able to reach all members (internal and external) relatively inexpensively. Which communication channel would best suit this purpose?

Answers

Answer:

You Need To Quickly Send And Receive Professional Messages That May Contain Text Files And Short Media. These Messages Need To Be Accessible At Any Time Of The Day And In Different ... You work for a public relations (PR) firm and communicate regularly with the internal team and the clients on a PR campaign.

Explanation:

Email would likely be the best communication channel to meet these requirements. Once an email is sent, it broadcasts across servers and arrives at the recipient’s/recipients’ mailbox(es) for access at the receiving party’s/(ies’) convenience. Email is also able to have attachments, and as such, will allow for text files and smaller media files (audio, video, or otherwise) to be attached and accessed easily.

Consider the following scenario: The asset value of your company’s primary servers is
$2 million, and they are housed in a single office building in Anderson, Indiana. Field offices are scattered throughout the United States, but the workstations located at the field offices serve as thin clients and access data from the Anderson servers. Tornados in this part of the country are not uncommon, and it is estimated that one will level the building every 60 years. Which of the following is the SLE for this scenario?
a) $2 Million
b) $1 Million
c) $500,000
d) $33,333.33

Answers

Answer: A.) $2million

Explanation:

SLE (Single Loss Expectancy) can be explained the expected loss to be incurred whenever an asset is exposed to risk. The expected loss is valued or calculeltes in monetary terms.

The Single Loss Expectancy is calculated using the formula :

SLE = Asset value (AV) × Exposure factor

In the scenario above ;

Asset value = $2million

Exposure factor = 1 ; risk of exposure occurs once in 60 years

Therefore,

SLE = $2million × 1 = $2million

Which of the following things could you do in order to tell if a pair of colors has strong contrast? A. Look at the colors on the visual spectrum. B. Put text or images of one color on top of the other color. C. Find out if they are additive or subtractive colors. D. Find out the Munsell numbers of each color.

Answers

Answer:

B

Explanation:

I'll be honest, I'm not 100% sure this is correct but I'm pretty sure it is. Good Luck :)

how to use command prompt​

Answers

Answer:

The answer to this question can be defined as follows:

Explanation:

The Command Prompt is a program, which available in windows operating systems, which imitates an input field with windows GUI(Graphic User Interface). It provides a text-based user interface, that can be used to run instructions inserted and carry out advanced organizational activities, following are the step to open a command prompt:

There are two-step to open the command prompt in windows:  

First, go to the start button the window. after open start type cmd on the search bar, It will provide the cmd to open it click with mouse or press enter button.    With the help of keyboard press (window+R) key together, after pressing it will provide the run prompt in which we write cmd and press enter. It will open a command prompt panel.    

convert the following decimal number to its equivalent binary ,octal,hexadecimal 1920​
pls in step by step
pls help me bro

Answers

Answer:

0b11110000000 is binary

0o3600 is in octal

0x780 in hexa dec.

Explanation:its a bit complitcated to explain sorry bro!

To build a user interface that contains graphical components, the components ____. must each be added to a separate panel. must be added directly to a frame component. must be added to a panel that is contained within a frame. must be added to a frame that is contained within a panel.

Answers

Answer:

To build a user interface that contains graphical components, the components must be added to a panel that is contained within a frame.

Explanation:

When approved for a loan, an individual essentially applied for aid in the area of...
A. Increasing (and financing) immediate increase in cash flow
B. limited liability
C. future educational services
D. protections and insurance

Answers

Answer:

The correct answer is A. When approved for a loan, an individual essentially applied for aid in the area of increasing (and financing), as it implies an immediate increase in cash flow.

Explanation:

Every loan involves the delivery of money by a bank or a financial agency to a person or company, with the consideration that the latter will later return said amount, plus an additional amount for interest, within a specified period and may pay in a single payment and in full or through an installment plan. But, in any case, the immediate result of said loan is an increase in the cash flow of the person who obtains said loan, which can be used for the acquisition of goods or services, or to face different eventual expenses.

Other Questions
A. MitochondriaB. Converts energyin the cellC. Stores food andwater in the cellD. MitochondrionWhat letter does not belong in each group and explain your thinking ? Write the set { 1, 3, 7, 15, 31, 63 } in set builder form Please help me:((((((( It is real urgent! Please and thank you PLEASE HELP ME ASAP!!!! I DON'T UNDERSTAND THIS!!!! Determine the number of solutions for the equation shown below x= x - 9 please help look at the picture.... Given the functions, f(x) = x2 + 2 and g(x) = 4x - 1, perform the indicated operation. When applicable, state the domain restriction.g(f(x)) Alice Jackson designed her company webpage to include a _______ page that directs visitors to a particular webpage and entices them to buy a featured product. Suppose that you add 28.8 g of an unknown molecular compound to 0.250 kg of benzene, which has a K f Kf of 5.12 oC/m. With the added solute, you find that there is a freezing point depression of 3.06 oC compared to pure benzene. What is the molar mass of the unknown compound When preparing a photo for a magazine, a graphic designer would most likely need to use a program such as Microsoft Excel to keep track of magazine sales. Microsoft Word to write an article about the photo. Adobe Photoshop to manipulate the photo. Autodesk Maya to create 3-D images that match the photo. n + 42/3 = 2 n = ______ McConnell owns a small computer firm thag he inherited from his father. He has no other source of income, but he might start another small firm a couple of months later. What form do you think he should fill for filling his returns? A. W-2 form B. IRS return form C. W-4 form D. 1040-EZ form Which scientist performed an experiment with curved-necks flasks in order to further support the results of Redi's experiment? A. Louis Pasteur B. Charles Darwin C. Ludwid Hirszfeld D. Stephen Hawking 40 thousandths= how many hundredths? I'll mark brainliest for whoever answers first :D The National Labor Union invited skilled craftsmen, unskilled laborers, and farmers to join. This means it is an example of which type of union? if (ax+b)(ax+c)=4x^2-25 for all values of x, and a, b, and c are constants, what is the value of b+c? The tread life of a particular brand of tire is normally distributed with mean 60,000 miles and standard deviation 3800 miles. Suppose 35 tires are randomly selected for a quality assurance test. Find the probability that the mean tread life from this sample of 35 tires is greater than 59,000 miles. You may use your calculator, but show what you entered to find your answer. Round decimals to the nearest ten-thousandth (four decimal places). Solve by completing the square. x212x=27 Select each correct answer. 9 3 3 9 15 Before the pandemic cancelled sports, a baseball team played home games in a stadium that holds up to 50,000 spectators. When ticket prices were set at $12, the average attendance was 30,000. When the ticket prices were on sale for $10, the average attendance was 35,000. (a) Let D(x) represent the number of people that will buy tickets when they are priced at x dollars per ticket. If D(x) is a linear function, use the information above to find a formula for D(x). Show your work! (b) The revenue generated by selling tickets for a baseball game at x dollars per ticket is given by R(x) = x-D(x). Write down a formula for R(x). (c) Next, locate any critical values for R(x). Show your work! (d) If the possible range of ticket prices (in dollars) is given by the interval [1,24], use the Closed Interval Method from Section 4.1 to determine the ticket price that will maximize revenue. Show your work! Optimal ticket price:__________ Maximum Revenue:___________ Ramani has 3 times as many two -rupee coins as she has five- rupee coins . If she has in all a sum of Rs.77 , then how many coins of each denomination does she have ?