Complete the function by filling in the missing parts. The color_translator function receives the name of a color, then prints its hexadecimal value. Currently, it only supports the three additive primary colors (red, green, blue), so it returns "unknown" for all other colors. m 1 - def color_translator(color): 2. if _== "red": 3 hex_color = "#ff0000" 4- elif == "green": 5 hex_color = "#00ff00" elif == "blue": hex_color = "#0000ff" in 0 hex_color = "unknown" return _ . 12 13 14 15 16 17 print(color_translator("blue")) # Should be #0000ff print(color_translator ("yellow")) # should be unknown print(color_translator("red")) # Should be #ff0000 print(color_translator ("black")) # should be unknown print(color_translator("green")) # Should be #00ff00 print(color translator("")) # should be unknown Run Reset

Answers

Answer 1

Answer:

The completed program is

def color_translator(color):

      if color == "red":

             hex_color = "#ff0000"

      elif color == "green":

             hex_color = "#00ff00"

      elif color == "blue":

             hex_color = "#0000ff"

      else:

             hex_color = "unknown"

      return hex_color

Explanation:

Since the parameter in the above function is color,

This variable will serve as the name of a color and it'll be used in the conditional statements to check if the name of color is any of red, green and blue;

And that is why we have

if color == "red":

elif color == "green":

elif color == "blue":

The variable used to hold the color codes, hex_color, will be returned at the end of the function and that's why we have

return hex_color

When the program is tested with print(color_translator("blue")) and others, it prints the desired output


Related Questions

Define Proportional spacing fornt.​

Answers

Answer:

Alphabetic character spacing based on the width of each letter in a font. ... Proportional spacing is commonly used for almost all text. In this encyclopedia, the default text is a proportional typeface, and tables are "monospaced," in which all characters have the same fixed width.

hope this answer helps u

pls mark me as brainlitest .-.

a reason for giving a Page Quality (PQ) rating of Highest, is it the page has no Ads?

Answers

Answer:

quality of highest giving page hash no adds

Use the Excel worksheet data below to solve the following questions.
H
1
J
5
6
7
7
8
5
do 00
9
10
A
12
8
11
9
T
9
3
4
w
9
11
12
13
14
15
17
15
7
M
column H 2n cicle de genula
ingles are creation CHF HIM)
2. Write the function that would find the average cells in
(2 marks)
3. Write the function that would find the total values in column J (2 marks)
4. Write the function that would count all values.
(2 marks)
5. Write the function that would count the number of
occurrences of 9 in the entire range
(3 marks)

Answers

Answer:

I love Microsoft Excel!

Explanation:

2 - The function that would find the average of a particular range is =AVERAGE(). This is used to find the average of something by calculating the arithmetic mean (or just "mean").

3 - The function that would find the total values within a particular range---or in this case, Column J---you would use the =SUM() function. This will add up all of the values in the range you selected. An example could be that Column X has the values of 5, 6, 12, 45, 3. =SUM(X1:X5) = 71.

4 - The function that would count all values is defined as =COUNT(). An example would be =COUNT(A1:A10).

5 - The function that would count the number of occurrences within a particular range is defined as =COUNTIF(). Within the parentheses, you would put the range of data that you are working with. Then, in quotations, you would put the name or value that you are trying to find.

In your case, it would be =COUNTIF(range,"9") ((I put range in there since I do not know what your range is as it is not defined within the context of this question))

The bank offers the following types of accounts to its customers: saving accounts, checking accounts and money market accounts. Customers are allowed to deposit money into an account (thereby increasing its balance), withdraw money from an account (thereby decreasing its balance) and earn interest on the account. Each account has an interest rate

Assume that you will write the code for an application that will calculate the amount of interest earned for a bank account.

a. Identify the potential classes in this problem domain be list all the nouns
b. Refine the list to include only the necessary class names for this problem
c. Identify the responsibilities of the class or classes.

Answers

C is the correct answer

Alice and Bob are unknown to each other. Alice wants to send an encrypted message to Bob. So it chooses a KDC which is known to both Alice and Bob (protocol in page 338). Alice and KDC have A5 (hexa) as a shared key. Bob and KDC have 4B (hexa) as a shared key. Alice sends a request to KDC to generate a session key so it can communicate with Bob. KDC generates 56(hexa) as a session key. Alice intends to send 13 (hexa) as a message to Bob. For simplicity assume that the encryption and decryption operations are simply XOR operation of the key with the message. Answer the following.
1. What information does KDC send to Alice? Show as hex characters.
2. What information does Alice send to Bob? Show as hexa characters.
3. What message does Bob retrieve after decryption? Show as hexa characters.

Answers

3. ¿Qué mensaje recupera Bob después del descifrado? Mostrar como caracteres hexadecimales.

Respuesta: la clave con el mensaje :

Speeding is one of the most prevalent factors contributing to traffic crashes.
A. TRUE
B. FALSE

Answers

Answer:

A true

Explanation:

Speeding leads to an increase in the degree of crash severity, possibly resulting in more fatalities or injuries. More damage is caused to the vehicles involved at higher speeds, increasing likelihood vehicle will not be drivable after a crash.

The statement "Speeding is one of the most prevalent factors contributing to traffic crashes" is true.

What is speeding?

Speeding causes crashes to be more severe, which could lead to more fatalities or injuries. Higher speeds result in more damage to the involved vehicles, increasing the risk that the vehicle won't be drivable following a collision. There are many accidents increasing because of high speed.

The term "speeding" refers to moving or traveling swiftly. He paid a penalty for speeding. For many American drivers, speeding has become the standard, whether it is going over the posted speed limit, driving too quickly for the road conditions, or racing. Nationwide, speeding contributes to road fatalities.

Therefore, the statement is true.

To learn more about speeding, refer to the link:

https://brainly.com/question/15297960

#SPJ2

 A ………….. is a basic memory element in digital circuits and can be used to store 1 bit of information.

Answers

Answer:

A memory cell

Explanation: Research has proven that ;

The memory cell is also known as the  fundamental building block of computer memory.

It stores one bit of binary information and it must be set to store a logic 1 (high voltage level) and reset to store a logic 0 (low voltage level).

Advantages of e commerce

Answers

Answer:

A Larger Market

Customer Insights Through Tracking And Analytics

Fast Response To Consumer Trends And Market Demand

Lower Cost

More Opportunities To "Sell"

Personalized Messaging

Hope this helps!

how do you run a function in python?

Answers

You can call a Python function like so: function(parameters).

Example:

Define function add:
def add(x,y):
return x+y

Call function:
add(3,7) -> 10

Consider a network that is a rooted tree, with the root as its source, the leaves as its sinks, and all the edges directed along the paths from the root to the leaves. Design an efficient algorithm for finding a maximum flow in such a network. What is the time efficiency of your algorithm

Answers

Answer:

please mark me brainlist

Explanation:

Is it appropriate to send an email and call the individual the same day to ask if they have received your email?

Answers

Answer:

It depends. (OPINION)

Explanation:

If this is an important email, and it REALLY had to be sent the day of, then yes, it may be appropriate to call the day of. However, if you procrastinated until the last day and are really worried; well; that's your fault. At least wait a day and give the receiver some time to process; they could be really busy. At least that's how I view it.

list 2 forms of computer output​

Answers

Audio, visual, and hard copy media

Answer:

Soft copy like audio

Hard copy e.g printouts

Explanation:

consider l= 5 ,r= 11. you must determine the sum of the values of the function in the range L to R . you have to calculate sum = lrf(x) in python coding

Answers

def summation (num1, num2):

i = 0

for x in range (num1 : num2 + 1):

i += x

return i

print ( summation(l, r))

why you think Operating System is pivotal in teaching and learning.

Answers

Answer:

An Operating System is pivotal in teaching and learning because:

1. It enables computer users to communicate with the hardware.

2. To run any computer programme successfully, the Operating System is basic.

3. It provides a smooth interface for teachers to use video conferencing or other conferencing systems in teaching their students.

4. The OS enables the launching of other learning packages on a computer system.

5. Students can install learning apps on their systems with the help of the OS.

Explanation:

An Operating System is a software which brings about easy communication with the hardware and enablea other programs to run on the computer easily. It provides basic functionality in systems were they are installed.

"The fact that we could create and manipulate an Account object without knowing its implementation details is called"

Answers

Answer:

Abstraction

Explanation: Abstraction is a software engineer terminology that has been found to be very effective and efficient especially as it relates to object-oriented computer programming. It has helped software engineers and other computer experts to effectively manage account objects without having a knowledge of the details with regards to the Implementation process of that account object.

Describe how tuples can be useful with loops over lists and dictionaries,
and give Python code examples.
Create your own code examples. Do not copy them from the textbook or any other source.
Your descriptions and examples should include the following: the zip function, the enumerate function, and the items method.

Answers

Answer:

what is computer

what is simple machine

what is output device

The program to check the highEst of n numbercan be done by ......,..

Answers

Answer: Given an array of numbers, arrange them in a way that yields the largest value. For example, if the given numbers are {54, 546, 548, 60}, the arrangement 6054854654 gives the largest value. And if the given numbers are {1, 34, 3, 98, 9, 76, 45, 4}, then the arrangement 998764543431 gives the largest value.

Explanation: If you need more help follow me on istagram at dr.darrien

-thank you

what are three ways to add receipts to quick books on line receipt capture?

Answers

Answer:

1) Forward the receipt by email to a special receipt capture email

2) You can scan, or take a picture of the receipt and upload it using the QuickBooks mobile app.

3) You can also drag and drop the image, or upload it into QuickBooks Online receipt center.

Explanation:

1) Th first process is simply done using the email address

2) On the app, tap the Menu bar with icon ≡.  Next, tap Receipt snap., and then

tap on the Receipt Camera. Yo can then snap a photo of your receipt, and tap on 'Use this photo.' Tap on done.

3) This method can be done by simply navigating on the company's website.

WILL MARK BRAINLIEST

Write a function called quotient that takes as its parameters two decimal values, numer and denom, to divide. Remember that division by 0 is not allowed. If division by 0 occurs, display the message "NaN" to the console, otherwise display the result of the division and its remainder.

(C++ coding)

Answers

https://docs.microsoft.com/en-us/dotnet/api/system.dividebyzeroexception?view=net-5.0#remarks

click in link

What is wrong with the following if statement (there are at least 3 errors).
The Indentation indicates the desired behavior.

if numNeighbors >= 3 || numNeighbors = 4
++numNeighbors;
printf ("You are dead! \n “);
else
--numNeighbors;

Answers

In programming, if statements are used to test conditions. The statement to be executed will be determined by the result of the conditions. A statement will be executed if its accompanying condition is true.

The errors in the given code segment are as follows:

The if condition on line 1 should be in a closed bracket; i.e. ()The if condition has more than 1 statements to execute. So, it requires a curly bracket; i.e. {}The second part of the first condition should be == 4 and not =4; because the proper operator to make comparison is == while = is used as an assignment operator

The correct code is as follows:

if (numNeighbors >= 3 || numNeighbors == 4) {

++numNeighbors;

printf ("You are dead! \n “); }

else

--numNeighbors;

Read more about conditional statements at:

https://brainly.com/question/20228453

Which one is the result of the ouWhen you move a file to the Recycle Bin, it will be immediately deleted from your computer.

A. True

B. Fals

Answers

Answer:

B => false

Explanation:

it just keep it on recycle bin => not being removed

False

Explaination :

The deleted file will stay in Recycle Bin for a short period of time before it's permanently deleted from your computer

Assume the existence of a Phone class. Define a derived class, CameraPhone that contains two data members: an integer named, imageSize, representing the size in megabytes of each picture, and an integer named memorySize, representing the number of megabytes in the camera's memory. There is a constructor that accepts two integer parameters corresponding to the above two data members and which are used to initialize the respective data members. There is also a function named numPictures that returns (as an integer) the number of pictures the camera's memory can hold.

Answers

#include <iostream>

using namespace std;

class CameraPhone:Phone{

int imageSize,memorySize;

public:

CameraPhone(int image_size,int memory_size):imageSize(image_size),memorySize(memory_size){}

int numPictures(){

return memorySize-imageSize;

}

}

int main(){}

Here is the code for the derived class, CameraPhone:

class Phone:

 def __init__(self, brand, model, price):    self.brand = brand    self.model = model    self.price = price

class CameraPhone(Phone):

 def __init__(self, brand, model, price, imageSize, memorySize):    super().__init__(brand, model, price)    self.imageSize = imageSize    self.memorySize = memorySize

 def numPictures(self):

   return self.memorySize // self.imageSize

What are the derived class?

This code defines a derived class, CameraPhone, that inherits from the Phone class. The CameraPhone class has two additional data members: imageSize and memorySize. The constructor for the CameraPhone class takes two additional parameters corresponding to these data members. The numPictures() function returns the number of pictures that the camera's memory can hold.

Here is an example of how to use the CameraPhone class:

phone = CameraPhone("Apple", "iPhone 13 Pro", 1000, 10, 100)

print(phone.numPictures())

# Output: 10

This code will print the number of pictures that the camera's memory can hold, which is 10 in this case.

Find out more on derived class here: https://brainly.com/question/31942927

#SPJ2

What is the quick key to highlighting a column?
Ctrl + down arrow
Ctrl + Shift + down arrow
Right-click + down arrow
Ctrl + Windows + down arrow

Answers

The quick key to highlighting a column is the Ctrl + Shift + down arrow. Thus, option (b) is correct.

What is column?

The term column refers to how data is organized vertically from top to bottom. Columns are groups of cells that are arranged vertically and run from top to bottom. A column is a group of cells in a table that are vertically aligned. The column is the used in the excel worksheet.

The quick key for highlighting a column is Ctrl + Shift + down arrow. To select downward, press Ctrl-Shift-Down Arrow. To pick anything, use Ctrl-Shift-Right Arrow, then Ctrl-Shift-Down Arrow. In the Move/Highlight Cells, the was employed. The majority of the time, the excel worksheet was used.

As a result, the quick key to highlighting a column is the Ctrl + Shift + down arrow. Therefore, option (b) is correct.

Learn more about the column, here:

https://brainly.com/question/3642260

#SPJ6

Answer:

its (B) ctrl+shift+down arrow

hope this helps <3

Explanation:

Input a list of positive numbers, find the mean (average) of the numbers, and output the result. Use a subprogram to input the numbers, a function to find the mean, and a subprogram to output the result. Use a subprogram to Input the numbers, a Function to find the mean and a subprogram to output the Result.

Answers

Answer:

def inputNumber():

   l = []

   num = int(input("Enter the number of integers you want to enter\n"))

   for i in range(0,num):

       print("Enter the ", i+1, " integers ")

       a = float(input())

       l.append(a)

   return l

def averageCalculator(l):

   total = 0

   for i in l:

       total += i

   avg = total/len(l)

   return avg

def printoutput(avg):

   print("The average of numbers is ", avg)

l = inputNumber()

avg = averageCalculator(l)

printoutput(avg)

Explanation:

A subprogram may be considered as a method where we pass some values in the arguments and return some value.

The answer is written in python language, where we have used

inputNumber() subprogram to get the input from the user.

function averageCalculator() to calculate the average.

printoutput() subprogram to print the output or the average of the numbers.

Please refer to the attached image for better understanding of the indentation of code.

Now, let us learn about them one by one:

inputNumber(): We get the number of values to be entered as an integer value and then get the numbers as float.

Store the values in a list and return the list to the caller main program.

averageCalculator(l): Contains a list as argument as we got from inputNumber(). It sums all the numbers and divides with total number to find the average. Returns the average value to the caller main program.

printoutput(avg): Contains an argument which is the average calculated in the averageCalculator(). It prints the argument passed to it.

You are the network administrator for your company. A user reports that he cannot access network resources from his computer. He was able to access the resources yesterday. While troubleshooting his computer, you find that his computer is issued an Automatic Private IP Addressing (APIPA) address. All the network equipment in the user's computer is functioning properly because you are able to access the user's computer from a remote computer. What is most likely the problem

Answers

Answer:

the issued Automatic Private IP Addressing (APIPA) address.

Explanation:

Since we are told that the user was able to access the network resources yesterday, and all the network equipment in the user's computer is functioning properly, there is a very high possibility that because the user's computer has been issued an Automatic Private IP Addressing (APIPA) address, it affected his computer's ability to connect to a public network.

This is the case because private network IP addresses are known to prevent inflow and outflow of data onto public networks.

Where can you find detailed information about your registration, classes, finances, and other personal details? This is also the portal where you can check your class schedule, pay your bill, view available courses, check your final grades, easily order books, etc. A. UC ONE Self-Service Center B. Webmail C. UC Box Account D. ILearn

Answers

Answer:

A. UC ONE Self-Service Center

Explanation:

The UC ONE Self-Service Center is an online platform where one can get detailed information about registration, classes, finances, and other personal details. This is also the portal where one can check class schedule, bill payment, viewing available courses, checking final grades, book ordering, etc.

it gives students all the convenience required for effective learning experience.

The UC ONE platform is a platform found in the portal of University of the Cumberland.

Maintaining public libraries is a waste of money since computer technology can replace their functions. Do you agree or disagree?

Answers

Answer:

I totally do not agree that maintaining public library is a waste of money

Explanation:

Most library are now advancing in terms of service delivery and public

libraries are no exception as libraries are now incorporating E- platforms/E- libraries, Audio visuals, where anyone can learn or borrow materials electronically.

         Furthermore, not everyone can own a computer set to so that public libraries are even relevant to the majorities who can afford a computer set.

Also a library especially the public library is a place where people can meet and socialize to the end we even make friends at the public library more effectively than the online library can make(if they can).

In summary the pros of physical public libraries can not be over emphasized.

 

Your system is infected with a virus that can modify signature each time it is executed to fool antivirus software. Which type of virus is this?

Answers

Answer:Polymorphic Virus

Explanation:

Malware that can change its signature each time is polymorphic

An employer plans to pay bonus to each of his employees. Those earning Rs. 2000 or above are to be paid 10 percent of their salary and those earning less than 2000 are to be paid Rs. 200. The input record contains employee number, name and salary of an employee. The output should be employee name and their bonus. Write pseudo code algorithm to process the requirement.

Answers

Answer:

vfg

Explanation:

CHALLENGE ACTIVITY 3.7.2: Type casting: Reading and adding values.
Assign totalowls with the sum of num_owls A and num_owls_B.
Sample output with inputs: 34
Number of owls: 7
1. total_owls -
2.
3. num_owls A - input
4. num_owls_B - input
5.
6. " Your solution goes here
7.
8. print("Number of owls:', total_owls)

Answers

Answer:

total_owls = 0

num_owls_A = int(input())

num_owls_B = int(input())

total_owls = num_owls_A + num_owls_B

print("Number of owls:", total_owls)

Explanation:

Initialize the  total_owls as 0

Ask the user to enter num_owls_A and num_owls_B, convert the input to int

Sum the num_owls_A and num_owls_B and set it to the total_owls

Print the total_owls

avg_owls=0.0

num_owls_zooA = int(input())

num_owls_zooB = int(input())

num_owls_zooC = int(input())

num_zoos = 3

avg_owls = (num_owls_zooA + num_owls_zooB + num_owls_zooC) / num_zoos

print('Average owls per zoo:', int(avg_owls))

There is a problem while you are trying the calculate the average owls per zoo.

As you may know, in order to calculate the average, you need to get the total number of owls in all the zoos, then divide it to the number of zoos. That is why you need to sum num_owls_zooA + num_owls_zooB + num_owls_zooC and divide the result by num_zoos

Be aware that the average is printed as integer value. That is why you need to cast the avg_owls to an int as int(avg_owls)

Learn more about integer value on:

https://brainly.com/question/31945383

#SPJ6

Other Questions
Read the excerpt from Warriors Don't Cry. The announcer said it was 7:55 as Mama squeezed into a parking space, and we settled ourselves quietly for a moment, trying to identify the buzzing noise that seemed as if it were all around us. It resembled the sound of crowds at my high school football games. But how could that be Add THREE words to the second sentence in each pair so that it means the same as the first. Buying that phone was a big mistake. I _______________ _______________ _______________ bought that phone. Kevin is too young to drive.Kevin is not _______________ _______________ _______________ drive. * n my family, theres no better driver than my mother. In my family, my mother _______________ _______________ _______________. * Iaan fell asleep because he was really tired. Ian was _______________ _______________ _______________ he fell asleep. * Vivians voice is so perfect! Vivian has _______________ _______________ _______________ voice! * If you eat too much, youll have a stomachache. Youd _______________ _______________ _______________ so much or youll have a stomachache. This cake is so hot you cant eat it. This cake is too _______________ _______________ _______________. * Its not necessary for Henry to wear a school uniform. Henry _______________ not _______________ _______________ wear a school uniform. * S. E. Hinton said in an interview that she really gets to know her characters. In fact, she says she focuses more on them than on the setting in her books. In the first chapter of The Outsiders, how does she describe the greasers?by using mostly indirect characterizationby showing how each one handles conflictby using the plot details to show what theyre likeby using mostly direct characterization think about a character in a book or short story who you would like to interview. then write, four questions you would ask this character. explain why you would ask each question. to earn credit for this forum, state the name of the character, the title of the work, and the author. please someone help me Is 1.45 times 10 to the -7 power a scientific notation Which equation is represented by the graph? What happened during the Haymarket Riot of 1886? A. A dynamite bomb was thrown into the crowd. B. Union members changed their terms mid-protest and continued striking. C. Union members reached a settlement after rioting. D. Police became violent with union members. Always true, sometimes true, never true? (x-1)(1+3)>0, x Help!!! Simplify each expression A synthetic fiber used in manufactoring dress fabric is? A. Rayon B. Wool C. Cotton D. Silk In health promotion, the most important nursing role is:a. teaching safe health practicesb. assessing the individual's health needsc. reducing potential health-risk factorsd. changing established life style You pull one card at random from a standard deck and you shuffle the remaining cards. Then you pull another card. Is the event independent or dependent? Find the volume of this cone.Use 3 for T.12ft125ftV = Tr?V [?]ft3V I need help with this math problem please (3x+2)(5x-7) A product with an MSRP of CNY 15.00 has a promotion allowance of 15%. How much will the distributor receive in promotion allowance for each unit how the process of succession might occur in a small pond on cow pasture The British expedition in 1497 led to the discovery of what is known today as ______________.A) NewfoundlandB) QuebecC) MontrealD) St. Augustine Given the function h(t) = 2t to the power of 2 + 9 evaluate h(5) how do i say " My family and i are going to visit Chile this spring. I have to book our flights before we leave for Chile. My parents have to put a camera and our sandals in the suitcase. We are going to take a bus around the city of Santiago, and we are going to see the marble caves. I am ready for this trip!". In spanish, please help Help me please