Question

You have been given the following lists of Color and their specific codes: Colors = ['Red','Blue','Green','Black','Yellow',‘Orange’,‘Purple’,‘Nocolor’]...

You have been given the following lists of Color and their specific codes:

Colors = ['Red','Blue','Green','Black','Yellow',‘Orange’,‘Purple’,‘Nocolor’]

Codes = [97,17,19,128,66,111,231,00]

1. Using codeDict, find the score for 'Nocolor'.

2. Add a code of 333 for 'Nocolor'.

3. Create a sorted list of all the codes in codeDict.

4. Update the name for 'Nocolor' to be ‘white’

5. White was not a part of original colors list so, just Delete it and its code from codeDict.

USE PYTHON CONSOLE AND SUBMIT THE PYTHON SCRIPTS FOR ALL FIVE QUESTIONS

Homework Answers

Answer #1
Colors = ['Red','Blue','Green','Black','Yellow','Orange','Purple','Nocolor']
Codes = [97,17,19,128,66,111,231 ,0]
codeDict = {Colors[i]:Codes[i] for i in range(len(Colors))}
# answer 1.
print("code for Nocolor is",codeDict['Nocolor'])
#answer 2.
codeDict['Nocolor'] = 333
# answer 3
Sorted_Codes = []
for color in Colors:
    Sorted_Codes.append(codeDict[color])
Sorted_Codes.sort()
print("sorted code list",Sorted_Codes)
# answer 4.
codeDict['white'] = codeDict['Nocolor']
del codeDict['Nocolor']
# answer 5.
del codeDict['white']
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
The Color Mixer The colors red, blue, and yellow are known as the primary colors because...
The Color Mixer The colors red, blue, and yellow are known as the primary colors because they cannot be made by mixing other colors. When you mix two primary colors, you get a secondary color, as shown down below. Once you have complete that task, use a repetition structure down below. When you mix red and blue, you get purple. When you mix red and yellow, you get orange. When you mix blue and yellow, you get green. Using While...
A coworker claims that Skittles candy contains equal quantities of each color (purple, green, orange, yellow,...
A coworker claims that Skittles candy contains equal quantities of each color (purple, green, orange, yellow, and red). In other words, 1/5 of all Skittles are purple, 1/5 of all Skittles are green, etc. You, an avid consumer of Skittles, disagree with her claim. Test your coworker's claim at the α=0.10 level of significance, using the data shown below from a random sample of 200 Skittles. Which would be correct hypotheses for this test? H0:p1=p2 ; H1:p1≠p2 H0: Red Skittles...
Milk Chocolate M&M’s come in 6 colors; blue, orange, green, yellow, red, and brown. Choose the...
Milk Chocolate M&M’s come in 6 colors; blue, orange, green, yellow, red, and brown. Choose the color of M&M’s you will be working with for this project Color: GREEN Using the collected data below from a single fun-sized bag, provide the frequency and proportion of M&M’s in your color of choice. Red Orange Yellow Green Blue Brown 2 1 2 3 5 1 Number of M&M's in your color: Total number of M&M's: Proportion of M&M's in your color: Construct...
A particular brand of sour candy comes in packages with seven (7) colors (red, orange, yellow,...
A particular brand of sour candy comes in packages with seven (7) colors (red, orange, yellow, green, blue, purple, and white). The manufacturer claims the seven colors are equally represented in each bag. In a goodness of fit experiment to test their claim, Professor Oehrlein's students collected many, many bags of the candy and counted the frequency of each color of candy. Each of the thirty (30) students collected five (5) bags of twenty-one (21) candies. What is the expected...
A color code personality test categorizes people into four colors – Red (Power), Blue (Intimacy), Green...
A color code personality test categorizes people into four colors – Red (Power), Blue (Intimacy), Green (Peace), and Yellow (Fun). In general, 25% of people are Red, 35% Blue, 20% Green, and 20% Yellow. An art class of 45 students is tested at a university and 7 are found to be Red, 18 Blue, 9 Green, and 11 Yellow. Can it be concluded that personality type has an impact on students’ areas of interest and talents, such as artistic students...
M&M chocolates come in six different colors: red, orange, yellow, green, blue and brown. A market...
M&M chocolates come in six different colors: red, orange, yellow, green, blue and brown. A market researcher believes that the six color proportions are not evenly distributed for the population of all M&Ms produced. To test this theory, he first selects his significance level to be 10% and then sets up the following goodness of fit test null hypothesis: H0: All 6 M&M color proportions are equal to 1/6 Suppose that the six colors are evenly distributed for the population...
Plain M&M's come in 6 different colors (Blue, Orange, Green, Yellow, Red, Brown) and are produced...
Plain M&M's come in 6 different colors (Blue, Orange, Green, Yellow, Red, Brown) and are produced at two different plants. M&M's that come from a plant in Tennessee are supposed to have the following distribution of colors: 20.7% Blue; 20.5% Orange; 19.8% Green; 13.5% Yellow; 13.1% Red and 12.4% Brown. Quality control at the plant is concerned the machine is not working correctly and that it is producing a different distribution of colors. They take a random sample of 940...
M&Ms are multicolored candies in a bag with six colors: Brown, Blue, Red, Yellow, Green and...
M&Ms are multicolored candies in a bag with six colors: Brown, Blue, Red, Yellow, Green and Orange. Mars now claims that all six colors are equally likely. In an attempt to reject the claim, an 8-oz bag of M&Ms was purchased and the colors counted. The results of the count are below. Does this sample contradict Mars’ claim when α = 0.10? Brown Blue Red Yellow Green Orange 37 41 32 25 36 39 If the claim is true what...
Milk Chocolate M&M’s come in 6 colors; blue, orange, green, yellow, red, and brown. The color...
Milk Chocolate M&M’s come in 6 colors; blue, orange, green, yellow, red, and brown. The color is red and the number of candies is 25/200 total M&Ms 1. Choose your favorite color of M&M’s you will be working with for this project. State the color and give the counts below. Color of choice: Number of M&M's in your color: Total number of M&M's: Proportion of M&M's in your color: 2. Construct a 95% confidence interval for the proportion of M&M’s...
We’ve learned that the visible spectrum is typically defined as ROYGBIV (Red/ Orange/Yellow/Green/Blue/Indigo/Violet) thanks to Newton....
We’ve learned that the visible spectrum is typically defined as ROYGBIV (Red/ Orange/Yellow/Green/Blue/Indigo/Violet) thanks to Newton. But there are colors in our box of crayons that aren’t in this list. We can find many colors by mixing others. What colors would be mixed to make brown or gray? Refer to the CIE diagram in your answer
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT