Learn String Manipulation by Building a Cipher - Step 44

Hello, there is an explanation to this lesson,
" As you can see in your output, when the loop iterations reach the space, a space is added to the encrypted string. Then the code outside the if block executes and a c is added to the encrypted string."

My question is: why a ‘c’ is added to the encrypted string in this situation? why the letter ‘c’? I don’t understand.

because in that case index is -1, adding 3 it makes 2 which is the index of c

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.