Write a program checkLuminance that will input red, green, and blue values, and compute the luminance using the weighted average (as below). But then print out a warning to the user based on the computed luminance:
• If the luminance is less than10, “That’s going to be awfully dark.”
• If the luminance is between 50 and 200, “Looks like a good range.”
• Over 250, “That’s going to be nearly white!”
```
def checkLuminance(redValue, greenValue, blueValue): luminance = (redValue+greenValue+blueValue)/3
if luminance <10:
print "That's going to be awfully dark."
if (luminance >50) and (luminance<200):
print "Looks like a good range."
if luminance>250:
print "That's going to be nearly white!"
```
You might also like to view...
Which keyword is used to specify that a class will define the methods of an interface?
a. uses b. implements c. defines d. extends
The BASH shell is an example of a(n)____.
A. interpreter B. compiler C. kernel file D. machine code file
Oracle database consists of logical and physical database structures. Describe each of the following concepts and state to which structure they belong:
(a) Schema; (b) Data block; (c) Redo log file.
Why is password length important?
A. Longer passwords take much less time to crack than shorter passwords B. Shorter passwords take much more time to crack than Longer passwords C. Password length has nothing to do with the time needed to crack it. D. Longer passwords take much more time to crack than shorter passwords