Answer:
To find the standard deviation of the rating for the data, you can use the summarize() and sd() functions as follows:
# summarize the rating column and store the result in a variable
summary = summarize(df$Rating)
# calculate the standard deviation of the rating
stddev = sd(df$Rating)
# print the standard deviation
print(stddev)
Here, "df" is the name of the data frame that contains the Rating column. The summarize() function calculates various summary statistics for the Rating column, including the mean and standard deviation. The sd() function calculates the standard deviation of the Rating column.
Note that the summarize() function is not a built-in function in R. It is a user-defined function that may be part of a package or created by the user. The sd() function, on the other hand, is a built-in function in R that calculates the standard deviation of a numeric vector.
I hope this helps! Let me know if you have any questions.
Question 1 of 10 Which two scenarios are most likely to be the result of algorithmic bias? A. A person is rejected for a loan because they don't have enough money in their bank accounts. B. Algorithms that screen patients for heart problems automatically adjust points for risk based on race. C. The résumé of a female candidate who is qualified for a job is scored lower than the résumés of her male counterparts. D. A student fails a class because they didn't turn in their assignments on time and scored low on tests.
Machine learning bias, also known as algorithm bias or artificial intelligence bias, is a phenomenon that happens when an algorithm generates results that are systematically biased as a result of false assumptions made during the machine learning process.
What is machine learning bias (AI bias)?Artificial intelligence (AI) has several subfields, including machine learning. Machine learning relies on the caliber, objectivity, and quantity of training data. The adage "garbage in, garbage out" is often used in computer science to convey the idea that the quality of the input determines the quality of the output. Faulty, poor, or incomplete data will lead to inaccurate predictions.Most often, issues brought on by those who create and/or train machine learning systems are the source of bias in this field. These people may develop algorithms that reflect unintentional cognitive biases or actual prejudices. Alternately, the people could introduce biases by training and/or validating the machine learning systems using incomplete, inaccurate, or biased data sets.Stereotyping, bandwagon effect, priming, selective perception, and confirmation bias are examples of cognitive biases that can unintentionally affect algorithms.To Learn more about Machine learning bias refer to:
https://brainly.com/question/27166721
#SPJ9
Hi!
i want to ask how to create this matrix A=[-4 2 1;2 -4 1;1 2 -4] using only eye ones and zeros .Thanks in advance!!
The matrix A=[-4 2 1;2 -4 1;1 2 -4] can be created by using the following code in Matlab/Octave:
A = -4*eye(3) + 2*(eye(3,3) - eye(3)) + (eye(3,3) - 2*eye(3))
Here, eye(3) creates an identity matrix of size 3x3 with ones on the diagonal and zeros elsewhere.
eye(3,3) - eye(3) creates a matrix of size 3x3 with ones on the off-diagonal and zeros on the diagonal.
eye(3,3) - 2*eye(3) creates a matrix of size 3x3 with -1 on the off-diagonal and zeros on the diagonal.
The code above uses the properties of the identity matrix and the properties of matrix addition and scalar multiplication to create the desired matrix A.
You can also create the matrix A by using following code:
A = [-4 2 1; 2 -4 1; 1 2 -4]
It is not necessary to create the matrix A using only ones and zeroes but this is one of the way to create this matrix.
Give a real-world example of a selection control structure.
An example of selection structure is when a group of people wanted to know the exact number of days through the use of a data set that has the daily high temperature which ranges from above 80 degrees, and as such, a programmer can use the if-end statement.
What is an if statement?An IF statement is known to be a kind of statement that is executed due to the happening of a specific condition.
Note that IF statements must start with IF and end with the END.
Therefore, An example of selection structure is when a group of people wanted to know the exact number of days through the use of a data set that has the daily high temperature which ranges from above 80 degrees, and as such, a programmer can use the if-end statement.
Learn more about if-end statement from
https://brainly.com/question/18736215
#SPJ1
Write your algorithm that run quick sort can be made to run O(n log n)time b) Write the recurrence that shows the running time of your algorithm in (a) above c) Briefly explain (no need to prove) how your recurrence records O(n log n)time in worst-case
Answer:
Explanation:
a) In random Pivot Quick Sort algorithm, a Central Pivot element is chosen. In this algorithm Pivot element is selected as it is not Central Pivot. It means the array is divided such that any part contains at-least ¼ elements.
Algorithm for Quick Sort using Random Pivot
randomQuick(num[ ],low,high)
Step 1 – if low index > = high index then Exit.
Step 2 – while pivot p is not the Central Pivot.
Step 3 – Choose any value randomly as the Pivot value. Assume it as p.
Step 4 – Count the elements smaller than num[p]. Store it as small.
Step 5 – Count the elements greater than num[p]. Store it as great.
Step 6 – Assume size = (high – low + 1) . if small > = size/4 and greater >=n/4, then p is Central Pivot.
Step 7 – Use pivot p to partition num [low…high].
Step 8 – randomQuick(num, low, small - 1)
Step 9 – randomQuick(num, great + 1, high)
b) As from the above algorithm the array is partitioned in such two parts that one part has at-least n/4 elements. Thus, it is possible that in worst case, array is partitioned in two parts such that one part has n/4 elements and other part has 3n/4 elements and its time complexity will be O(log N).
Whereas there is a loop in the above algorithm. So, complexity is O(n)
Now consider the following recurrence relation:
T(n) = T(n/4) + T(3n/4) + O(n)
= O(log n) + O(n)
= O(n log n).
c) In QuickSort as randomly Pivot is generated. Here, in the above algorithm one condition follows the array is divided in such two partitions that one part has n/4 elements and the other part has 3n/4 elements.
In worst case, the height of recursion tree is Log3/4 n.
Q8: Oliver invested some
2 points
money 5 years ago at 12% p.a.
interest (compounded
quarterly) and now received a
payment of N$50000. How
much was his initial
investment?
Answer:
The initial amount invested by Olivia is $ 27,683.79
Explanation:
The amount of initial investment can be computed using the present value formula given below:
PV=FV*(1+rs/t)^-n*t
FV is the future amount which is $50,000
rs is the rate of interest which is 12% per annum
t is the number of times interest is compounded yearly which is 4 times
n is the number of years the funds were invested i.e 5 years
PV=$50,000*(1+12%/4)^-4*5
PV=$50,000*(1+3%)^-20=$27,683.79
which one of the following decreases as the strength of the attractive intermolecular forces increases? A.The heat of vaporization B.The boiling point of a liquid C.The vapor pressure of a liquid
The vapor pressure of a liquid decreases as the strength of the attractive intermolecular forces increases.
The vapor pressure of a liquid is the point, in a closed container, at which equilibrium pressure is reached between molecules leaving the liquid and entering the gas phase and molecules leaving the gas phase and entering the liquid phase.
The vapor pressure of liquids can be measured in a number of ways. A simple measurement is to inject liquid into a closed flask connected to a pressure gauge. Click here for illustrations. When a solid or liquid evaporates into a gas in a closed container, molecules cannot escape.
Vapor pressure (or equilibrium vapor pressure) is the pressure exerted by a vapor in thermodynamic equilibrium with a condensed phase (solid or liquid) at a given temperature in a closed system.
To know more about vapor pressure, visit:-
https://brainly.com/question/2693029
#SPJ4
working with the tkinter(python) library
make the window you create always appear on top of other windows. You can do this with lift() or root.attributes('-topmost', ...), but this does not apply to full-screen windows. What can i do?
To make a tkinter window always appear on top of other windows, including full-screen windows, you must use the wm_attributes method with the topmost attribute set to True.
How can I make a tkinter window always appear on top of other windows?By using the wm_attributes method in tkinter and setting the topmost attribute to True, you can ensure that your tkinter window stays on top of other windows, even when they are in full-screen mode.
This attribute allows you to maintain the window's visibility and prominence regardless of the current state of other windows on your screen.
Read more about python
brainly.com/question/26497128
#SPJ1
A client has the right to receive ethically conducted research. Discuss this statement with examples.
A client has the right to receive ethically conducted research. This means that the researcher should adhere to the principles of scientific research, which includes honesty, objectivity, integrity, and respect for human subjects. In addition, the researcher should ensure that the research is conducted in a safe and responsible manner.
What is research?
Research is defined as "creative and methodical activity done to improve the body of knowledge." It entails the objective gathering, organising, and analysis of data in order to improve comprehension of a subject or issue. A research effort could build on prior contributions to the field. Research may duplicate portions of earlier projects or the project as a complete to verify the accuracy of instruments, processes, or experiments.
Documentation, discovery, interpretation, as well as the research and development (R&D) of methods & systems again for advancement of human knowledge are the main goals of basic research (as opposed to applied research). Research methodologies are based on epistemologies, which differ greatly within and between the humanities and sciences.
To learn more about research
https://brainly.com/question/25257437
#SPJ13
Conditional formatting allows spreadsheet users to
turn cell protection functions on and off.
calculate the average number of people at sporting events.
highlight test scores of below 90% in a grade book.
add additional formatting options to a menu.
It C. highlight test scores of below 90% in a grade book.
Answer:
CExplanation:
highlight test scores of below 90% in a grade book.
Answer:
C. highlight test scores of below 90% in a grade book.
Explanation:
:)
What kind of material is used for DRAM (dynamic random-access memory)?
The kind of material that is used for DRAM (dynamic random-access memory) is metal-oxide-semiconductor.
What is DRAM?DRAM was invented in 1968. It is a type of RAM used in modern computers and laptops. It is a type of random access memory. Its name is dynamic random access memory.
Metal-oxide-semiconductor is used in making the transistors and capacitors of the DRAM, which are used to store the data. They hold a bit of the data in these capacitors and transistors.
Thus, the material that is used is metal-oxide-semiconductor to make DRAM (dynamic random-access memory).
To learn more about DRAM, refer to the link:
https://brainly.com/question/20216206
#SPJ1
Tumblr, Jaiku is an example of _____________ website.
a) Microblogging
b) Blogging
c) Social Networking
d) None of the Above
Answer:
Microblogging One of the best-known channels in the microblogging world. Twitter is a quick and convenient way to share short posts, GIFs, article links, videos and more. Pinterest: Companies on Pinterest link to products, articles and other useful information for audiences .Explanation:
Hope this helps you !!A blank provides power to a hydraulic system by pumping oil from a reservoir into the supply lines
In a hydraulic system a reservoir baffle prevents the hydraulic oil from moving directly from the system return line to the pump suction line.
It should be understood that a hydraulic system simply means a mechanical function that operates through the force of liquid pressure.
In this case, in a hydraulic system a reservoir baffle prevents the hydraulic oil from moving directly from the system return line to the pump suction line.
Learn more about hydraulic system on:
brainly.com/question/1176062
#SPJ1
xamine the following output:
Reply from 64.78.193.84: bytes=32 time=86ms TTL=115
Reply from 64.78.193.84: bytes=32 time=43ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=47ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=44ms TTL=115
Reply from 64.78.193.84: bytes=32 time=73ms TTL=115
Reply from 64.78.193.84: bytes=32 time=46ms TTL=115
Which of the following utilities produced this output?
The output provided appears to be from the "ping" utility.
How is this so?Ping is a network diagnostic tool used to test the connectivity between two network devices,typically using the Internet Control Message Protocol (ICMP).
In this case, the output shows the successful replies received from the IP address 64.78.193.84,along with the response time and time-to-live (TTL) value.
Ping is commonly used to troubleshoot network connectivity issues and measureround-trip times to a specific destination.
Learn more about utilities at:
https://brainly.com/question/30049978
#SPJ1
How university has utilised Information Technology in society for efficient business process?
Employees can easily understand and identify their goals, targets, or even if the exertion used was undertaking or not with the help of strong information technology.
What is information technology?The use of technology to communicate, transfer data, and process information is referred to as information technology.
Among the various trends in information technology are, but are not limited to, analytics, automation, and artificial intelligence.
The use of computers, storage, networking, and other physical devices, infrastructure, and processes to create, process, store, secure, and exchange all forms of electronic data is referred to as information technology (IT).
With the assistance of powerful information technology, employees can easily understand and identify their goals, targets, or even whether the exertion used was undertaken or not.
Thus, universities utilized Information Technology in society for efficient business process.
For more details regarding information technology, visit:
https://brainly.com/question/14426682
#SPJ1
With clear examples, describe how artificial intelligence is applied in fraud detection
Answer:
AI can be used to reject credit transactions or flag them for review. Like at Walmart
Explanation:
I work with AI, i know what i'm talking about.
Code to be written in python:
Correct answer will get brainliest :)
Mr Wu has been going to work every day by taxi for many years. However, the taxi fare has been increasing rather quickly in recent years. Therefore, he is considering driving to work instead. One of the costs for driving is the parking fee. The parking rates of the car park at Mr Wu's workplace are as shown as below:
Weekdays:
$2 per hour between 4am and 7am
$1.20 per half hour between 7am and 6pm
$5 per entry after 6pm
Saturdays:
$2.50 per hour between 4am and 7am
$1.50 per half hour between 7am and 6pm
$7 per entry after 6pm
Sunday: Flat rate of $5 per entry
For all days, there is a grace period of 10 minutes.
The car park opens between 4am and 12 midnight daily. We assume vehicles are magically ejected at midnight.
There is a 10% surcharge on weekdays and a 20% surcharge on Saturdays for vehicles who park for more than 10 hours. There are no surcharges on Sunday.
There is an additional fee of $3 for exiting after 10pm on any day.
Your task is to write a function compute_fee(day, time_in, time_out) that computes the parking fee, where day is an integer between 1 and 7, with 7 representing Sunday, while time_in and time_out are integer values in a 24-hour format - e.g. 700 for 7am and 2359 for 11:59pm. Assume all input is valid.
Below are a few examples of how the fee is calculated:
Example 1: Tuesday, 4:29am to 7:50am.
• 4:29am to 7am is charged as 3 1-hour slots: $2.00 * 3 = $6.00
• 7am to 7:50am is charged as 2 30-minute slots: $1.20 * 2 = $2.40
• Total fee = $6.00 + $2.40 = $8.40
Example 2: Saturday, 7:01am to 7:49pm.
• 7:01am to 6pm is charged as 22 30-minute slots: $1.50 * 22 = $33.00
• 6pm to 7:49pm is charged as one entry: $7.00
• 20% Surcharge for parking more than 10 hours: ($33.00 + $7.00) * 20% = $8.00
• Total fee = $33.00 + $7.00 + $8.00 = $48.00
Example 3: Sunday, 3pm to 10:01pm.
• 3pm to 10:01pm is charged as one entry: $5.00
• Additional fee for exiting after 10pm: $3.00
• Total fee = $5.00 + $3.00 = $8.00
Example 4: Thursday, 11:49pm to 11:59pm.
• Grace period
• Total fee = $0.00
Example 5: Monday, 12pm to 10:01pm.
• 12pm to 6pm is charged as 12 30-minute slots: $1.20 * 12 = $14.40
• 6pm to 10:01pm is charged as one entry: $5.00
• 10% Surcharge for parking more than 10 hours: ($14.40 + $5.00) * 10% = $1.94
• Additional fee for exiting after 10pm: $3.00
• Total fee = $14.40 + $5.00 + $1.94 + $3.00 = $24.34
def compute_fee(day, time_in, time_out):
"""Your code here"""
Test Cases:
compute_fee(2, 429, 750) 8.4
compute_fee(6, 701, 1949) 48
compute_fee(7, 1500, 2201) 8
compute_fee(4, 2259, 2301) 0
compute_fee(1, 1200, 2201) 24.34
Here is the requested Python function that computes the parking fee based on the given information:
Which phrase best describes a data scientist?
A. A person who develops advanced computing languages
B. A person who designs and develops hardware for computers
C. A person who builds and installs the memory chips for household
appliances
OD. A person who uses scientific and statistical methods to analyze
and interpret large, complex digital data sets
W
SUBMIT
Answer:
D. A person who uses scientific and statistical methods to analyze and interpret large, complex digital data sets.
Explanation:
data is information, information is Data, comparison of both
Answer:
"Data is raw, unorganized facts that need to be processed. Data can be something simple and seemingly random and useless until it is organized. When data is processed, organized, structured or presented in a given context so as to make it useful, it is called information. Each student's test score is one piece of data. "
Data is defined as facts or figures, or information that's stored in or used by a computer. An example of data is information collected for a research paper. An example of data is an email.
Hope this Helps
Mark Brainiest
A printer is considered to be in the category of
a. software
Selected:b. hardware
c. operational system
d. equipment
A printer is considered to be in the category of b. hardware.
What is hardware?Computer hardware contains the physical characteristics of a computer, such as a case, central processing unit (CPU), random access memory (RAM), monitor, mouse, keyboard, computer data storage, pictures card, sound card, speakers, and motherboard.
Hardware directs to the physical components of a computer. Also directed to as the machinery or the equipment of the computer. Examples of hardware in a computer exist the keyboard, the monitor, the mouse, and the processing unit However, most of a computer's hardware cannot be caught; It's inside the computer case.
A printer exists as an external hardware output device that brings the electronic data stored on a computer or other device and develops a hard copy.
Hence, A printer is considered to be in the category of b. hardware.
To learn more about hardware refer to:
https://brainly.com/question/24370161
#SPJ2
(plsssssssssssssssssssssssssssssssssssssss helpp meee)
think about system you know,list the parts of the system,describe some ways that the parts are connected to the whole
Answer:
A computer is a complex machine. While most of it works on a microscopic level, it certainly has recognizable macroscopic components that contribute to its uses. A computer can be used to do just about anything from simple calculations to preparing reports to sending rockets into space to simulating the spread of cancer in body organs. Some of the parts are, the motherboard, the power supply, the central processing unit, the optical drive ect. The motherboard plays roles like storing some simple information when the computer is off, such as the system time. The power supply, as you might have already guessed is the powerhouse of the computer. The CPU mainly does arithmetic and logical tasks. It will make a bunch of calculations to ensure the functions of the computer are carried out efficiently. An optical drive is used to read CDs and DVDs, which can be used to listen to music or watch movies. They can also be used to install software, play games, or write new information into a disk.
Explanation: O///O sorry if this is bad....
You are working on a documentation file userNotes.txt with some members of your software development team. Just before the file needs to be submitted, you manager tells you that a company standard requires that one blank space be left between the end-of-sentence period (.) and the start of the next sentence. (This rule does not affect sentences at the very end of a line.) For example, this is OK: Turn the knob. Push the "on" button. This is not: Turn the knob. Push the "on" button. Asking around among your team members, you discover that some of them have already typed their sentences in the approved manner, but others have inserted two or even more blanks between sentences. You need to fix this fast, and the first thing you want to do is to find out how bad the problem is. What command would you give to list all lines of userNotes.txt that contain sentence endings with two or more blanks before the start of the next sentence?
Answer: Provided in the explanation section
Explanation:
The question says :
You are working on a documentation file userNotes.txt with some members of your software development team. Just before the file needs to be submitted, you manager tells you that a company standard requires that one blank space be left between the end-of-sentence period (.) and the start of the next sentence. (This rule does not affect sentences at the very end of a line.) For example, this is OK: Turn the knob. Push the "on" button. This is not: Turn the knob. Push the "on" button. Asking around among your team members, you discover that some of them have already typed their sentences in the approved manner, but others have inserted two or even more blanks between sentences. You need to fix this fast, and the first thing you want to do is to find out how bad the problem is. What command would you give to list all lines of userNotes.txt that contain sentence endings with two or more blanks before the start of the next sentence?
Solution:
Here, our fundamental aim is to look for the content which is having single space between different sentences. As it sentences finishing with . Going before with single and various spaces we have to channel and match just e the sentences which are finishing with ". "
For this we use order called "GREP" in Unix. "GREP " represents worldwide quest for standard articulation. This order is utilized inquiry and print the lines that are coordinating with determined string or an example. The example or indicated string that we have to look through we call it as customary articulation.
Syntax of GREP:
GREP [OPTIONS] PATTERN [FILE_NAME]
For our solution please follow the command
GREP "*\•\s$" userNotes.txt
Now it will display a all the lines having . Followed by single space.
A text that is arranged in a one letter column is called a?
A text that is arranged in a one-letter column is called a "one-letter-per-line" format.
It is a style of formatting where every letter or word in a text is written on a separate line, usually used for emphasis or aesthetics in writing. One-letter-per-line formatting is a writing style that has been used throughout history and has become more popular in modern times, particularly with the rise of the internet and social media.
One-letter-per-line format can be used to create a variety of effects in writing. For example, it can be used to create a sense of emphasis or to draw attention to a particular word or phrase. It can also be used to create a sense of rhythm or to give a text a more visual or artistic quality. One-letter-per-line formatting can be used in poetry, prose, or any other type of writing, and it can be used to create a wide range of effects.
In conclusion, one-letter-per-line formatting is a writing style that is used to create emphasis, rhythm, or visual effects in writing. It can be used in a wide range of contexts, including poetry, prose, and social media, and it can be used to create a variety of effects depending on the writer's intentions.
For more such questions on one-letter, click on:
https://brainly.com/question/12435728
#SPJ8
1) In Java, what is a suitable code for the second phase directions with arrays?
Second Phase Directions attached:
Answer:
yo no entiendo nada de nada
Write a statement that takes a variable named file_object that contains a file object and reads its contents into a Python list of lines. Store the resulting list into a variable named file_contents.Write a statement that takes a variable named file_object that contains a file object and reads its contents into a Python list of lines. Store the resulting list into a variable named file_contents.
Answer:
Answered below
Explanation:
#file is first opened and saved into file_object variable.
file_object = open('new_file.txt', 'r')
file_contents = file_object.readlines()
#the readlines() reads the contents of the file, line by line and returns a list of lines. Therefore, file_contents contains a list of lines read from file object and can be iterated over to get each line.
this is a new capability for businesses provided by technologies able to analyze customer behavior over the internet.
The new capability for businesses provided by technologies able to analyze customer behavior over the internet is customer segmentation. The correct option is d.
What is customer segmentation?Customer segmentation is the process of categorizing customers based on how and why they purchase. It enables businesses to develop more targeted sales and marketing strategies for certain customer segments.
Customer behavior segmentation includes inclinations and frequent acts, feature or product use, and habits. This allows you to target your audience more effectively with relevant messaging. To begin, it is critical to establish strong customer relationships.
Therefore, the correct option is d, Customer segmentation.
To learn more about customer segmentation, refer to the link:
https://brainly.com/question/28167080
#SPJ1
The question is incomplete. Your most probably complete question is given below:
Direct marketing.
Merchandise allocation.
Telephone trees.
Customer segmentation.
To rename a worksheet, you change the text on the ? HELP ASAP
A. Sheet Columns
B. Sheet Header
C. Sheet tab
Highlights the possible risks and problems that should be addressed during the implementation process
Answer:
The answer is below
Explanation:
Since the type of Implementation is not stated specifically, it is believed that, the question is talking about ERP Implementation, because it is related to subject in which the question is asked.
Hence, Enterprise Resource Planning (ERP) implementation deals basically, by carrying out installation of the software, transferring of finanancial data over to the new system, configuring application users and processes, and training users on the software
ERP Implementation Risks involve the following:
1. Inefficient Management and Project Activities.
2. Inadequate or No Training and Retraining of Customers or End-Users.
3. Inability to Redesign Business Processes to meet the Software requirements.
3. Incompetent or lack of Technical Support Team and Infrastructure.
4. Incapability to Obtain Full-Time Commitment of Employee.
5. Failure to Recruit and Maintained Qualified Systems, and Developers.
A help desk technician determines that a user's issue is caused by a corrupt file on their computer. What is the fastest way to transfer a good file to the computer?
The fastest way to transfer a good file to the computer is Use the C$ administrative share to copy the file.
How do I copy a file?To copy a file, right-click on the desired file and select Copy. Alternatively, you can use the keyboard shortcut. To copy the item: click Ctrl+C. Navigate to the folder you want to move or copy the item to and click Ctrl+V or right-click and select paste.
To automatically paste the text, you will be inserting the copied content, which is in the clipboard to the desired location by the user, since such an operation only works if something has previously been copied or cut.
See more about copy a file at brainly.com/question/18241798
#SPJ1
#Write a function called find_max_sales. find_max_sales will #have one parameter: a list of tuples. Each tuple in the #list will have two items: a string and an integer. The #string will represent the name of a movie, and the integer #will represent that movie's total ticket sales (in millions #of dollars). # #The function should return the movie from the list that #had the most sales. Return only the movie name, not the #full tuple. #Write your function here!
Answer:
I am writing a Python program:
This is the find_max_sales
def find_max_sales(tuple_list): #method that takes a list of tuples as parameter and returns the movie name which had the most sales
maximum=0 #stores the maximum of the ticket sales
name="" #stores the name of the movie with maximum sales
for tuple in tuple_list: # iterates through each tuple of the tuple list
[movie, sale]= tuple #tuple has two items i.e. movie contains name of the movies and sale holds the total ticket sale of the movie
if sale>maximum: #if the sale value of a tuple is greater than that of maximum sale value
maximum=sale #assigns the maximum of sales to maximum variable
name=movie # assigns the movie name which had most sales to name variable
return name #returns the movie name that had the most sales and not the full tuple
#Below is the list of list of movies. This list is passed to the find_max_sales method which returns the movies name from the list that had the most sales.
movie_list = [("Finding Dory", 486), ("Captain America: Civil War", 408), ("Deadpool", 363), ("Zootopia", 341), ("Rogue One", 529), ("The Secret Life of Pets", 368), ("Batman v Superman", 330), ("Sing", 268), ("Squad", 325), ("The Jungle Book", 364)]
print(find_max_sales(movie_list))
Explanation:
The program has a method find_max_sales that has one parameter tuple_list which is a list of tuples. Each tuple i.e. tuple has two items a movie which is a string and sale which is an integer. The movie represents the name of a movie, and the sales represents that movie's total ticket sales The function has a loop that iterates through each tuple tuple of the list tuple_list. Variable maximum holds the value of the maximum sales. The if condition checks if the value of tuple sale is greater than that stored in maximum, at each iteration. If the condition evaluates to true then that sale tuple value is assigned to maximum variable so that the maximum holds the maximum of the ticket sales. The name variable holds the name of the movie corresponding to the maximum sale tuple value. The method returns the movie name from the tuple_list that has the most sales.
For example in the above given movie_list , the maximum of sale is of the movie Rogue One. When the method is called it returns the movie name and not the full tuple so the output of the above program is:
Rogue One
Which of the following are advantages of automatic updates?
Answer:
a,b,d
Explanation:
a.they protect against viruses
b.they protect against hackers
d.they keep your computer running at peak performence
Answer:
They protect against viruses
Explanation: