Question: Write two functions called wavelength_to_color() and frequency_to_color() that ask the user for a unit (use input() to get the unit in nm or THz) either

 Write two functions called wavelength_to_color() and frequency_to_color() that ask the user

Write two functions called wavelength_to_color() and frequency_to_color() that ask the user for a unit (use input() to get the unit in nm or THz) either nanometer ('nm') or terahertz ('THz') and a value (a number). The code should print out the color of the light with that unit and value. Ex: if the user enters THz 487, the output should be that the light with that frequency is orange. If the user enters nm 392, the output should be that the light with that wavelength is purple. Assume that the user always enters valid values. Color Violet Blue Cyan Green Yellow Orange Red Wavelength 380- 450 nm 450-485 nm 485-500 nm 500-565 nm 565-590 nm 590-625 nm 625 - 740 nm Frequency 680-790 THz 620-680 THz 600-620 THz 530-600 THz 510-530 THz 480-510 THz 405-460 THz

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!