Learn String Manipulation by Building a Cipher - Step 12

Its beta, so here is feedback on this step. Is one expected to build a function? This was not introduced up to this point. What about text[0]? Somehow the discription of the job to do is not very clear.
Please help/comment on this
Regards

Please post your code so far and a link to the step. Thanks

1 Like

here is the link: https://www.freecodecamp.org/learn/scientific-computing-with-python/learn-string-manipulation-by-building-a-cipher/step-12
no code sofar, I was not able to understand what is really expected.

Ok, this is the goal of the step:

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

And here is the example

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.

Can you be a bit more specific about what part of the instructions you want explained in more detail (please don’t say “all of it” or “everything” - that doesn’t help me give a more precise answer!)

First of all thanks for effort. I wont say ‘all of it’, probably I mean the sequence of all of it. Before this all steps where more coherent.
Please get me right, I am new to Python but I have about 45 years of IT Experience. I could do such a cipher in some other language in deep sleep. Its more that I want to help find a more intuitive language for step 12 for a beginner. The individual statement are clear sofar. I hope this helps.
Kind regards

Ok… I’m not sure where to start then.

We are talking about string variables. A string is a series of letters and other characters.

a_string = "my dog Spot"

We can call built in methods on strings to use certain built in functionality

print(a_string.lower())

As an example, that built in method .lower() makes the entire string lowercase.

As the step says, we need to use the built in find() method. You use it by

a_string.find(the_thing_i_want_to_find)

The problem tells you the string, method, and input here:

Ok, clear sofar. Is the text variable the text variable which appeared first in step 3?

I’m not super familiar with this step, but it appears to be the case?

later on it ‘hallo world’ is assigned to some other variable and not really used again. So I assume the learner is free to choose the content of text.
I thinks I have enought information now. Thanks again.

It’s best not to go changing things that aren’t part of the instructions. That usually breaks the tests

1 Like

I agree, but then this step should be formulated much clearer. I thinke the creator of this course should know about beginners doubts. Is there some way to give feedback to the originator? The help in the forum is very good. So I know where to turn if I have future problems. Have a nice time
Rolf

Can you be more specific about how this doesn’t tell you what to do? To me, this looks like it gives an example that’s basically the answer, but you need to change a_string and char .

Everything is ok now. I have to stop working now on the PC. Thanks again.

Hi! I’m new to Python and am still learning. I’m stuck on Step 12 as well, and I’ve been reading the forum posts. Here’s my code, and I’m still getting the, “Sorry, your code doesn’t pass” message.

alphabet=‘abcdefghijklmnopqrstuvwxyz’
alphabet.find(text[0])

I believe I’ve correctly identified my string, properly formatted the find function, and added the “text[0]” to it. Am I missing something obvious?

If you have a question about a specific challenge as it relates to your written code for that challenge and need some help, click the Ask for Help button located on the challenge (it looks like a question mark). This button only appears if you have tried to submit an answer at least three times.

The Ask for Help button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.