+ 1
What is thr meaning of '%' in string formatting??
https://code.sololearn.com/cwI6eeB470in/?ref=app In this code I get different output if I change %a with %s. Does it have any special meaning if yes what it is and what are the other such character.
3 Respostas
+ 4
Using %s style formatters is the old way of string formatting.
Please check this link that explains the various ways to do this in python.
https://pyformat.info/
%a is supposed to refer to the ascii representation of the string.
+ 3
% is the prefix that indicates that what follows is the type of what should be formatted to.
%s means insert of a string
%a is no valid format which i know
(I also didn't find it in the tutorial linked below)
http://python-reference.readthedocs.io/en/latest/docs/str/formatting.html
Sry for my bad english.
+ 2
Checker 8763 thanks and your english is not bad, writing that again and again will make your brain think it is bad