On Thu, 18 Oct 2007 15:21:41 -0400, Gerard Brunick wrote:
> Is there a way to do:
>
> s = "I like python %i%s of the time." print s % (99, "%")
>
> without having to pass in "%"?
>
> Thanks,
> Gerard
Just double-up the % sign, e.g. "I like python %i%% of the time."
--
http://mail.python.org/m
> Is there a way to do:
>
> s = "I like python %i%s of the time."
> print s % (99, "%")
>
> without having to pass in "%"?
You mean like
s = "I like python %i%% of the time."
print s % 99
http://docs.python.org/lib/typesseq-strings.html
-tkc
--
http://mail.python.org/mailman/listinfo
Is there a way to do:
s = "I like python %i%s of the time."
print s % (99, "%")
without having to pass in "%"?
Thanks,
Gerard
--
http://mail.python.org/mailman/listinfo/python-list