Yellow Belt Promotion
If you received a Gold Star on Project 1, you have earned your Yellow Belt!
If not, here's what to do to get promoted.
If you received a Green Star of Project 1, you can earn your yellow belt
by solving the problem below. You can submit your answer by email (to
Yellow Belt Problem. If your from address does not match
your UVA ID, make sure to include your name and UVA ID in the email.
make_yellowerthat takes as input a color, and returns a color that is the average of the input color and
make_yellower function should behave like this:
>>> by = make_yellower(BLUE) >>> get_red(by) 127.5 >>> get_green(by) 127.5 >>> wy = make_yellower(WHITE) >>> get_red(wy), get_green(wy), get_blue(wy) (255.0, 255.0, 127.5) >>> wyy = make_yellower(wy) >>> get_red(wyy), get_green(wyy), get_blue(wyy) (255.0, 255.0, 63.75)
If you did not receive any star for Project 1, to advance to the Yellow Belt level you need to:
1. Complete Project 1. You may look at the solutions that were discussed in class, but should not copy them. You should write your own code, and not go back to the solutions once you start writing your code.
2. Solve the
is_redder problem below:
is_redderthat takes two colors as inputs, and returns
Trueif the first color is more red than the second color. (You may consider a color more red if its red component is higher than the other color, even if this doesn't match our perception well.)
You should get these interactions:
>>> is_redder(RED, BLACK) True >>> is_redder(BLACK, RED) False >>> is_redder(RED, PURPLE) True
3. Solve the Problem Yellow above. (You can add this to your
Submit your completed
turnin.py file by email.