Re: Python - Caeser Cipher Not Giving Right Output

2014-03-22 Thread Rustom Mody
On Saturday, March 22, 2014 7:52:28 PM UTC+5:30, Ian wrote: > On Mar 20, 2014 9:59 PM, "Dave Angel" wrote: > >  dtra...@gmail.com Wrote in message: > > > And I was wondering how I would add the partenthesis because I tried: > > > return numtochar(c1 + c2 (%26)) and it gave me an error. > > Please

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-22 Thread Ian Kelly
On Mar 20, 2014 9:59 PM, "Dave Angel" wrote: > > dtran...@gmail.com Wrote in message: > > And I was wondering how I would add the partenthesis because I tried: > > > > return numtochar(c1 + c2 (%26)) and it gave me an error. > > Please help us to help you by actually showing the traceback. > Doe

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-21 Thread Mark Lawrence
On 21/03/2014 04:23, dtran...@gmail.com wrote: Would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seeing double line spacing and single line paragraphs, thanks. -- My

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread dtran . ru
On Thursday, March 20, 2014 11:58:43 PM UTC-4, Steven D'Aprano wrote: > On Thu, 20 Mar 2014 20:23:49 -0700, dtran.ru wrote: > > > > > Thanks for your input Dave. Would the line be: > > > > > > return numtochar(c1 + c2 %26) > > > > Yes, that's the line that Dave is talking about. > > > >

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread Rustom Mody
On Friday, March 21, 2014 8:53:49 AM UTC+5:30, wrote: > On Thursday, March 20, 2014 11:16:50 PM UTC-4, Dave Angel wrote: > > > Hello good people I am working on a caeser cipher program for class. > > > However, I ran into a problem with my outputs. Up to a certain point for > > > example: > > > 1

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread Steven D'Aprano
On Thu, 20 Mar 2014 20:23:49 -0700, dtran.ru wrote: > Thanks for your input Dave. Would the line be: > > return numtochar(c1 + c2 %26) Yes, that's the line that Dave is talking about. The critical part is that expression "c1 + c2 %26" which gets calculated before being passed on to numtochar.

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread Dave Angel
dtran...@gmail.com Wrote in message: > On Thursday, March 20, 2014 11:16:50 PM UTC-4, Dave Angel wrote: >> dtran...@gmail.com Wrote in message: >> > >> >> > def two(c1 , c2): >> >> > c1 = chartonum(c1) >> >> > c2 = chartonum(c2) >> >> > return numtochar(c1 + c2 %26) >> >> >> >>

Re: Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread dtran . ru
On Thursday, March 20, 2014 11:16:50 PM UTC-4, Dave Angel wrote: > dtran...@gmail.com Wrote in message: > > > Hello good people I am working on a caeser cipher program for class. > > However, I ran into a problem with my outputs. Up to a certain point for > > example: > > > > > > 1. two('y',

Python - Caeser Cipher Not Giving Right Output

2014-03-20 Thread dtran . ru
Hello good people I am working on a caeser cipher program for class. However, I ran into a problem with my outputs. Up to a certain point for example: 1. two('y', 'z') Would give a '\x92' output instead of a 'x' output. Currently this is my code so far: def chartonum(ch): return ord(ch) -