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
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 youralphabet
string and passtext[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, anda_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
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.