There are several myths associated with the phrase “Mind your Ps and Qs.”
One says it was a warning to watch out for cheating bartenders who would short you when you ordered a pint or a quart.
Another says it means to watch your “pieds” (feet) and “queus” (wigs), or watch your behavior from head to toe. Yet another says it comes from the master printer reminding his young typesetters to distinguish between the letter P and the letter Q, which are virtually indistinguishable in lower case.
The author of the Dictionary of Phrase and Fable (1898) notes that of the several explanations he had heard, none were “wholly satisfactory,” but he preferred the interpretation “Be very circumspect in your behaviour” from the French dancing master’s caution to mind your “pieds” and “queues.” I don’t agree.
Personally, I lean toward the printing shop origin. A typesetter in those days had to arrange the type in rows in mirror image, and frankly, looking at a lower case P (p) and a lower case Q (q), which are the backward versions of each other, I can see how that would be very, very easy to confuse. But there is no sure-fire answer to this claim, so you’ll have to decide for yourself.