what the %?....

Simon Brunning simon.brunning at gmail.com
Tue Nov 8 05:54:57 EST 2005


On 07/11/05, john boy <xray_alpha_charlie at yahoo.com> wrote:
> Hey can somebody tell me what the "%" function does...I am not math
> illiterate...its just a new symbol for me....is it a divisor? remainder
> something another??

For numeric values, it's the modulo operator - see
<http://docs.python.org/ref/binary.html> and
<http://en.wikipedia.org/wiki/Modular_arithmetic>.

Over strings, '%' performs string formatting. See
<http://docs.python.org/lib/typesseq-strings.html>.

--
Cheers,
Simon B,
simon at brunningonline.net,
http://www.brunningonline.net/simon/blog/



More information about the Python-list mailing list