Learn String Manipulation by Building a Cipher - Step 14

Tell us what’s happening:

text = ‘Hello World’
shift = 3
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
text.find[0]

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
text.find[0]

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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 14

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

Well the given code is straight up wrong. you can’t use [ ] in method call, and find finds a substring not a index

what given code are you talking about?

find finds the index of the substring

Hi @amentiliben454

To implement this, you will use the .find() method discussed in the previous step. Modify your existing .find() call passing it text[0] as the argument instead of 'z' .

The code you provided is throwing an error.

Please read the instructions carefully. For this step you need to replace the argument in the .find() call with a specific expression.

Happy coding

1 Like

Queremos que nos encuentre el primer caracter de la cadena que está dentro de la variable ‘text’. Por tanto tenemos que poner text[0] dentro del método find().
Lo que a mi me pasaba es que ponía ‘text[0]’ dentro de find() así, entre comillas. Al poner text[0] sin comillas me aceptó el ejercicio.

- remoto
Así.

¡Por favor, no publique el código de solución en el foro, gracias!

Hopefully you were able to find the solution! If not, it looks like you’re on the right track.
You modified a bit too much. Focus your changes to the contents of the alphabet.find( ) instead of the .find( ) itself.