Hi, so I am working on the Pig Latin translator and I have an issue. I can make the code work perfectly fine and get the new word , but I do not fully understand the part of:
Let me explain myself:
- word[a:b] will give you back the string from index a to index b.
- len() will give you the number of characters of certain variable.
- If the index stars in 0, that means that the index of the last letter of a string will be len()-1
word = notebook
will be 8, but if I want to get back the K i would need to code
so if I want to get book out of word, I would need to do something like this:
When in the exercise I write the -1 it deletes the last letter.
I hope it is clear, and that smeone can help me understand. Thanks in advance!