We are going to write a python program that uses 2 lists: A list to hold the primary colors [Red, Yellow, Blue], or tuple (Red, Yellow, Blue) A list of integers to hold the color ratio pseudocode: Color List of primary colors Number list for ratios Loop: iterate through the Color list using a loop structure for each color in the list ask the user what ration they want update the second list with that ratio end Loop. Loop: iterate through both the Color list and its corresponding Number List output the Color name and its Ratio Number end loop. Example execution: input ratio for Red: 5 input ration for Yellow: 0 input ratio for Blue: 5 Red 5 parts Yellow 0 parts Blue 5 parts *this information will get feed to a paint mixing machine and we know in this example that equal parts Red and Blue will result in Purple paint being made Submit Paint.py
We are going to write a python program that uses 2 lists:
- A list to hold the primary colors [Red, Yellow, Blue], or tuple (Red, Yellow, Blue)
- A list of integers to hold the color ratio
pseudocode:
Color List of primary colors
Number list for ratios
Loop:
iterate through the Color list using a loop structure for each color in the list
ask the user what ration they want
update the second list with that ratio
end Loop.
Loop:
iterate through both the Color list and its corresponding Number List
output the Color name and its Ratio Number
end loop.
Example execution:
input ratio for Red: 5
input ration for Yellow: 0
input ratio for Blue: 5
Red 5 parts
Yellow 0 parts
Blue 5 parts
*this information will get feed to a paint mixing machine and we know in this example that equal parts Red and Blue will result in Purple paint being made
Submit Paint.py
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images