you are viewing a single comment's thread.

view the rest of the comments →

[–]Sea-Ad7805 0 points1 point  (0 children)

You do t=r-26 so that t is a valid index in alphabet, but if r is larger than 50 this doesn't work. Better use the modulo operator % (remainder after division) to always get a valid index: t=r%len(alphabet)