Learn String Manipulation by Building a Cipher - Step 12

Tell us what’s happening:

Please help me, I can’t find the solution to this problem.

Your code so far


# User Editable Region

alphabet = 'abcdefghijklmnopqrstuvwxyz'
text = 'Hello World'
shift = 3
char = text[0].lower()
position = alphabet.find(char)
print("The first character of the text '{}' is located at position {} in the alphabet string.".format(char, position))

# 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 Edg/120.0.0.0

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 12

Don’t add code that is not required. Please, try to stick with the instructions otherwise you won’t pass the tests.

You need to call .find() on alphabet and pass text[0] to the find method. You are supposed to do it in a single line.

1 Like

Welcome to the forum @peghuembamfon

The instructions:
image

Call the find method on the alphabet variable, then pass the text[0].
They did not specify to print anything.

Happy coding

Thanks, it worked now