What is %% for in Python?

What is %% for in Python?

%% 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 %%.

What is %% for in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *