Learn String Manipulation by Building a Cipher - Step 14

Tell us what’s happening:

The first kind of cipher you are going to build is called a Caesar cipher. Specifically, you will take each letter in your message, find its position in the alphabet, take the letter located after 3 positions in the alphabet, and replace the original letter with the new letter.

To implement this, you will use the .find() method discussed in the previous step. Modify your existing .find() call passing it text[0] as the argument instead of ‘z’.

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
a = alphabet.find('z')
b = alphabet.find('d')
b = a

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 14

What’s your question?

Welcome to the forum @madraximbaxriddinov

Modify your existing .find() call passing it text[0] as the argument instead of 'z' .

For this step you are not asked to create any variables.

Please reset the step to restore the seed code and try again.

Happy coding