Note To Frequency - F NOTE

The following table lists an octave of music notes, beginning with middle F, along with their frequencies. Note Frequency (Hz) F4 349.63 Begin by writing a program that reads the name of a note from the user and displays the notes frequency. Your program should support all of the notes listed previously. Once you have your program working correctly for the notes listed previously you should add support for all of the notes from F0 to F8. While this could be done by adding many additional cases to your if statement, such a solution is cumbersome, inelegant and unacceptable for the purposes of this exercise. Instead, you should exploit the relationship between notes in adjacent octaves. In particular, the frequency of any note in octave n is half the frequency of the corresponding note in octave n+1. By using this relationship, you should be able to add support for the additional notes without adding additional cases to your if statement. a=input() 
x=int(a[1]) 
print((349.63/(2**(4-x))))

Comments