I'm trying to understand the following Python quine:
s = 's = %r\nprint(s%%s)'
print(s%s)
In particular, I'm having trouble finding any info about that %% part. Anyone know what that does exactly, in this context?
Postscript: Sorry for the silly question - it's just an escape character. My google search was focused on %%, which didn't lead me in the right direction. Thanks to those who took the time to respond! :)
The duplicated() method returns a Series with True and False values that describe which rows in the DataFrame are duplicated and not. Use the subset parameter to specify if any columns should not be considered when looking for duplicates.
In Python, we use = operator to create a copy of an object. You may think that this creates a new object; it doesn't. It only creates a new variable that shares the reference of the original object.
%% means a percent symbol after using the % operator on your string.
'%' is a special symbol for substitutions, so when you put
'Hi %s'%name
you are substituting a variable into the string at the point where %s occurs. There are lots of other % codes for different uses. But to just get a percent symbol after substitution, you put %%.
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