(Solved) : Write Following Function Python Please Document Code Understand Q42784661 . . .

Write the following function in python and please document thecode so then i can understand it

—————————————————————————————————————————–

A standard piano has 88 keys that just repeat this pattern of notes over and over again. As you travel to the right the notes get higher, and they get lower as your travel to the left. The notes that are in higher octaves sound higher pitched, and the lower octaves sound lower pitched. You will use a combination of the note’s letter and the octave it is played in to accurately describe an individual key on the piano. Octave 5 Octave 4 Octave 3 F# Gi Al CB D CB D C# Di FG Al FG A II 11 cD EF GA B CDEF GLAa BCDEFTAB in a song, this would be F#3 this is A4! this would be G5 Notice how the notes themselves are repeated several times. A standard piano has 7 full octaves (1 through 7), but the first key will actually start at A0, and the last key will be C8. Octaves 0 and 8 on the piano are therefore incomplete, they will only have the notes A0, A#O, BO, and C8. By pressing any of the keys on the piano, you are causing a small hammer to hit a string that will vibrate at a particular frequency. A note is octave 5 will have twice the frequency of the same note in octave 4, which is why the octave 5 note sounds higher pitched. You can compute the frequencies for each note by implementing the following formula: FT Fo X 2″/12 Fo is the frequency of base note, in other words the note that you are using to tune all of the other notes. It is standard to tune your piano so that the note A4 is exactly 440Hz, but the function you write to generate the frequencies of the notes will use any arbitrary starting frequency. n is the number of half steps you are away from the base note (A4): n>0 means you are on a note above the base note oAf#4 is one half step above A4, so n=1 oB4 is two half steps above A4, so n-2 C#5 is four half steps above A4, so n-4 oA5 is twelve half steps above A4, so n=12 n

Answer to Write the following function in python and please document the code so then i can understand it ————————…