Learn String Manipulation by Building a Cipher - Step 14

Tell us what’s happening:

just help me with this i dont get what it wants anymore im lost

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
text[3]
 alphabet.find(text[0])

# 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/126.0.0.0 Safari/537.36 Edg/126.0.0.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 14

Hey there!
Remember that Python is indentation strict.

im sorry i still dont get it

Python relies on indentation to accomplish its work. Therefore, you should be careful when adding indentation to your code.

i dont know what indentation is sorry

This article will help so much with that.
here.

thanks for the help!

1 Like

Hi, @stephenmutheu

First of all, check tabbing and / or spaces at the beginning of every line:

text[3]
 alphabet.find(text[0]) #<---- check this line

Python is tab/space sensitive (tabs/spaces are used to scope your code).

Then, the exercise: I think you might want to firstly understand what a cipher does or at least this specific cipher. The cipher you are about to design is a Ceasar cipher. The shift is the number of places you have to move forward along the alphabet (your key) to replace the existing letters in your plaintext. The cipher is the function that makes the operations, and that is what you are about to write in python.

Because it is a function, you have to use a def expression somewhere.

Was this information helpful?