Hello good people, I am able to run my code and it works fine.
However I did a test of:
and received a '\x92' output instead of a 'x' output.
This is my code so far:
I am thinking I have messed up on my mod 26, however, I am at a lost where I might have went wrong in that. Any help would be appreciated.
EDIT: SOLVED.
Line 10 error in precedence. so ((c1 + c1)%26)
However I did a test of:
Code:
two('y', 'z')
This is my code so far:
Code:
def chartonum(ch):
return ord(ch) - 97
def numtochar(n):
return chr(n + 97)
def two(c1 , c2):
c1 = chartonum(c1)
c2 = chartonum(c2)
return numtochar(c1 + c2 %26)
EDIT: SOLVED.
Line 10 error in precedence. so ((c1 + c1)%26)
Comment