Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Pearsn eTex. cla Secure! https://view.ebookplus.pearsoncmg.com./e PEARSON :Y:boo

ID: 3872800 • Letter: P

Question

Pearsn eTex. cla Secure! https://view.ebookplus.pearsoncmg.com./e PEARSON :Y:booklU::1 1 J2/3 ::languageid:1 ::session!82424403233956558829201scenario:1: olotBook Welcxrme Sayed Has hirni Buaks helf Print Sellings |Help Sign Out Search Browse My Searches PYTHON Programming Exercises 153 7. Color Mixer O Table of Conents 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 here: Chapter 1: introducton to Computers and Phogramming Chapter 2 nput. Processing. and Orpr Chapter 3 Decision stuctures anc Boalean Logi Chapter 4 Repetion 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 Strucures Chapter 5 Func ons Chapter 6 Files and Exceptions Chapter 7 usts and Tuples Design a program that prompts the user to enter the names of two primary colors to mix. If the user enters anything other than "red," "blue," or "yellow," the program should display an error message. Otherwise, the program should display the name of the secondary color that results. Chapier & Mare Abcut Strings Chapter g Octananes and Chapter 10. Classes and 8. Hot Dog Cookout Calculator Assume hot dogs come in packages of 10, and hot dog buns come in packages of 8. Write a program that calculates the number of packages of hot dogs and the number of packages of hot dog buns needed for a cookout, with the minimum amount of leftovers. The program should ask the user for the number of people attending the cookout and the number of hot dogs cach verson will be given. The program should displav the following details chapter 11: rhertarce chapter 12 Recursion Index cooro-ro 2017 Pearson aon, Inc. All rights reserved 12:17 AM O Type here to search

Explanation / Answer

def mix_colors(primary1,primary2):
if primary1==primary2:
return primary1
elif primary1=="red" and primary2=="blue" or primary1=="blue" and primary2=="red":
return "purple"
elif primary1=="red" and primary2=="yellow" or primary1=="yellow" and primary2=="red":
return "orange"
elif primary1=="yellow" and primary2=="blue" or primary1=="blue" and primary2=="yellow":
return "green"
  
primary1=input("Please enter a primary color:")
primary2=input("Please enter another primary color:")

if primary1!="red" and primary1!="blue" and primary1!="yellow" or primary2!="red" and primary2!="blue" and primary2!="yellow":
print("These are not primary colors. I can't mix them")
else:
secondary_color=mix_colors(primary1,primary2)
  
print("When you mix the primary colors,", primary1, " and ",primary2,",you get secondary color", secondary_color, ".", sep=" ")

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote