This isn’t having a short attention span (or well maybe thats part of it), but probably something called “Optimal Arousal.”(This is psychology, not anatomy, please keep your mind out of the gutter Xp)
Optimal Arousal goes like this: When effort is low, more stimulus is better. When effort is high, less stimulus is better.
I’ll elaborate. Whenever you do something easy (like maybe some homework as an example), unless something else is happening (like music or a show) you tend to get drawn away or doze off. In this homework scenario, the effort is low, so in order to keep at it and do well on working on it, you need a higher amount of stimulus, like a movie.
If something is hard, like for instance a test, you probably will try to avoid noise, going so far as to hush others so you can concentrate. The effort is high so you want less stimulus.
Keep this in mind. It can help you focus, and make life a lot easier. Dont feel bad for doing lots of different things while you are just chillin. Enjoy the knowledge!