Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.
My code encrypts only three letters and stops, what can I do here?
Check your for loop condition. What would happen when the key was length 3, as in one of the check50 examples?
Instead of using the length of the key in the condition of the for loop, can you think of another way to wrap around the key, perhaps affecting the index?