I recently came across the following piece of code. It doesn't look valid because of the single instance of triple quotes but seems to work fine. Can anyone explain what's going on here?
return ("Validation failed(%s): cannot calculate length "
"of %s.""" % (self.name, value))`
All of the strings are concatenated first.
""
is an empty string.
The substitutions are then made.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With