Learn String Manipulation by Building a Cipher - Step 12

Tell us what’s happening:

Hello, I am not able to solve this task.

Your code so far


/* User Editable Region */

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'

/* 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/120.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 12

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

what have you tried?

absolute nothing:) I wasn’t able to figure it first time learning Python.

what are you having issues with? what is it that you are not understanding?

The whole task I guess…

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, and replace the original letter with the new letter.

Start by finding the position of the first letter in the string. One way is to use the built-in find() function:

a_string.find(char)

Above, char is the character you want to locate, and a_string is the string you want to parse.

At the end of your code, call find() on your alphabet string and pass text[0] to the function.

I don’t get this.

yeah, that’s the whole task…

which paragraphs are you understanding?

I don’t understand the last paragraph.

you mean

this paragraph?

it is saying you need to use the find function presented above, but with the variables that are present in your code.

“pass to the function” means you need to put the thing between the parenthesis

Yeah this is the thing I don’t know what to put.

exactly what’s written in the description, you puy alphabet and text[0]

alright like this
a_alphabet.find(text[0])

is the variable name a_alphabet?

I dunno…is it not???

look at the code again, you have the variable text and the variable alphabet you have created in the previous step, nowhere you have a variable a_alphabet

oh I see sorry for wasting your time and thank you ,I am more a tractile person.