The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

GeneralCody (5) [Avatar] Offline
#2 The modulus (%) operator provides a formatting capability similar to that of C’s sprintf.

Python is a content/context aware language.
When you use the % (percent) character in this context it is no longer a "modulus"/"modulo" operator, but an operator used to refer to the tuple containing the print call replacement content.

I'd say it is wrong to use modulo as the "operator" in this context.
naomi.ceder (135) [Avatar] Offline
Re: 3.3.4 Strings footnote
Yes, I agree. I believe that's a holdover from the first edition, but it never was really the modulus operator in this context. I'll fix that.