converting letters to numbers
rusi
rustompmody at gmail.com
Sun Oct 20 04:33:38 EDT 2013
On Monday, October 14, 2013 10:32:36 AM UTC+5:30, Steven D'Aprano wrote:
> On Sun, 13 Oct 2013 20:13:32 -0700, Tim Roberts wrote:
>
> > def add(c1, c2):
> > % Decode
> > c1 = ord(c1) - 65
> > c2 = ord(c2) - 65
> > % Process
> > i1 = (c1 + c2) % 26
> > % Encode
> > return chr(i1+65)
>
> Python uses # for comments, not %, as I'm sure you know. What language
> were you thinking off when you wrote the above?
Maybe Tim was putting in the percentage of CPU cycles (wetware cycles??) on Decode, Process and Encode. So we have the % but not the percent…
More information about the Python-list
mailing list