Punctuation in Quotation Marks

I was taught in school that punctuation always goes inside the quotation marks. But if I want to specify a specific character string, such as:

My password is, “raven.”

Doesn’t this imply that my password ends with a period? Is it acceptable to place the punctuation outside the quotes in this instance?

Standard American style is to put the punctuation inside the quotation marks, but obviously this causes problems with technical documentation. Therefore, it has become standard practice in technical books to either put punctuation marks outside quotation when giving code examples, or seperate such examples with blockquotes or a seperate typeface. e.g.

My password is



raven


It’s a convention accepted in America but not in England or most of the other English speaking world. It’s also a stupid convention. It is at best non-intuitive and at worst will lead to errors as you point out. It is one rule that I violate with glee.