So where does the period go: inside the closing quotation marks or outside?
OK, I should probably elaborate.
The idea that in American English periods and commas go inside the quotes and in British English they go outside is a bit oversimplified. The truth is that both variants have multiple style guides that solve the matter in different ways.
In American English, APA and AP Style agree on keeping periods and commas inside the quotes, and the CMO mostly agrees… but not one hundred percent. There’s always an exception and in this case, the exception is made for the end of a string of computer code.
When it comes to British English, here’s a post that I think does rather a good job of addressing British conventions. You’ll see mention of the Guardian Style Guide, the Radio Times stylebook, the Telegraph Style Book, and the Economist style guide.
Mind you these are not all the reference works that exist for the English language, only but a handful.
The conclusion is messy, just like life. In the end, if you want a clean, professional text, it really is about choosing one style and being consistent, no matter which side of the puddle you’re on.