Learn String Manipulation by Building a Cipher - Step 13

Tell us what’s happening:

i did not understand how to use the find() method.

Your code so far


# User Editable Region

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

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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 13

Hi there and welcome to our commmunity!

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

You have called the find method on text not alphabet. Also, inside the parentheses you should pass text[0] not text].

You can read more about how to use find() here:

https://www.w3schools.com/python/ref_string_find.asp

https://www.geeksforgeeks.org/python-string-find/

The find() method finds the [position number] of the first occurrence of the specified value.

txt = "Hello, welcome to my world."

x = txt.find("welcome")

print(x)

>>> 7

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