No! Wait! You didn't get the wrong lesson! We're just using the piano keyboard for illustrative purposes. These really are guitar lessons. But the piano keyboard is better for showing some basic music and harmony concepts. We'll get to the guitar soon. Really!
Shown at the left is a small section of the piano keyboard. The solid keys show the scale of C major. The "phantom" keys show that the pattern of white and black keys repeats every 12 keys, as do the note names.
The black keys have two names, but only one pitch. These are called enharmonic notes. The reasoning behind having two names for each of these keys will become more apparent as you learn more about harmony theory. The # means sharp (higher) and the b means flat (lower) than the adjacent lower or higher key, respectively. I know, I know, that sounds a little confusing. Have patience. It'll get clearer.
If you start on C and play each of the white keys in succession from left to right, you are playing a C major scale. This is the familiar do-re-mi-fa-sol-la-ti-do scale. (If you played all the keys, white and black, you'd be playing what's called a "chromatic" scale.) All major scales follow the pitch interval of the white keys in C major. Which brings us to the numbers written beneath the note names on the illustration.
There is a pitch interval of 1/2-tone, or 1/2-step between each adjacent key on the keyboard. (On the guitar, there is a 1/2-step interval between succeeding frets on a given string.) A major scale consists of whole- and half-step intervals. The numbers beneath the note names indicate the intervals between the notes. Notice that there is no black key (no half-step) between E and F, nor is there one between B and C. So we see that the tone(step) intervals for C major are 1-1-1/2-1-1-1-1/2.
Now this is really important, so get ready to remember the following statement: All major scales follow this interval relationship. No matter what note you start on, you have to maintain these pitch intervals to play the major scale of that starting note. For example, play a major scale starting with D instead of C. D to E, whole step, no problem, E to F . . . hmm, that's only a half step and we need another whole step. Already we see what the black keys are for! E to F#, whole step, F# to G, half step, etc. We eventually find that we need to do the same thing at the B-to-C# interval. We just played a D major scale.
Why do we call the first black key that we needed F# instead of Gb? Mostly because we don't want to have both Gb and G in the same scale, and no F. Want an example with a flat instead? Start a major scale on F and see what happens. This may give you an inkling of what the key signature is for on written music.
In our first example, we found that we needed two sharped notes to play a D major scale. If you got the second example right, you found out that you need one flatted note (Bb) to play an F major scale. The Key Signature are the sharps or flats that appear at the beginning of a staff of music that tell you what scale to use for a given piece without the composer having to write in the little sharps and flats for every note that needs to be sharped or flatted. This makes written music easier to read as well as write. By the way, the sharps and flats are called "accidentals." Why? Dave Stewart put it thusly: "As a child, when I got my first toy piano, I quickly surmised that the white keys were there for playing `right' notes, and the black keys were only there in the event that one wanted to play a `wrong' note." This is pretty much the real reason.