I have to define a function add(c1, c2), where c1 and c2 are capital
letters; the return value should be the sum (obtained by converting the
letters to numbers, adding mod 26, then converting back to a capital
letter).

What I have so far is
def add(c1, c2):
    ans = ''
    for i in c1 + c2:
        ans += chr((((ord(i)-65))%26) + 65)
    return ans

Any guidance would be great, thanks.
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to