What is a key signature?
Below is a simple melody:
To avoid having to write the sharp sign (#sharp) in the same positions throughout the piece of music, musicians get lazy. They put it once at the start of the stave, just after the clefs. Below is the same music but with this change.
Just like the time signatures, anything in this area gets called a signature. In this case, they call the amounts of sharps (#sharp) or flats (#flat) key signatures.
All of these keys are sharp and fit into the locks of flats.
A key signature is a set of sharp (#sharp) and flat (#flat) symbols, placed immediately after the clef sign.