Learn String Manipulation by Building a Cipher - Step 13

Tell us what’s happening:

Describe your issue in detail here.
How to add .find .
Above, uppercase 'W' is the character you want to locate inside the string stored in the text variable. The method will return 6, which is the index of the 'W' character inside the string stored in the text variable.

At the end of your code, call .find() on your alphabet string and pass text[0] to the method. Note that a method is just a function that belongs to an object. I’m new to this and it’s making my last nerves dry hump. Please help brother out.

Your code so far


# User Editable Region

text = 'Hello World'
shift = 6
alphabet = ('abcdefghijklmnopqrstuvxyz')
print(text.find("W"))





    

# 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 OPR/106.0.0.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 13

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.

Welcome to the forum @goty421

The instructions here are asking you to use the .find() method on a string, passing an argument.

Here is no mention of a print call for step 13.

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

Happy coding

1 Like

Thank you, I restored it back to the original code. I’m still confused on where .find goes

text = ‘Hello world’

shift = 3

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

It gets attached to the end of the variable.

I know it’s annoying but it this looking more like it
text = ‘Hello world’
shift = 3
alphabet.find() = ‘abcdefghijklmnopqrstuvwxyz’

Start the code on a new line

This is only my second day learning this , ill end of getting the hang of it
text = ‘Hello world’

shift = 3

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

alphabet.find(“w”)

This needs to be this:
image
not the string w

bro you are the best

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.