Learn String Manipulation by Building a Cipher - Step 14

Tell us what’s happening:

Hi, the output of program was 7
i think the output is correct
but it showing that your code does not pass
what should i need to change in this program to make it correct and why please explain.

Your code so far


/* User Editable Region */

text = 'Hello World'
text = text.lower()
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
index = alphabet.find(text[0])
print(index)

/* User Editable Region */

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 14

the output can’t be seven as the uppercase letter H is not present in the alphabet string, you need to use the lower() method as instructed

You can transform a string into its lowercase equivalent with the lower() function. Add another print() call to print text.lower() and see the output.

1 Like

in second line i use lower() mehtod
i run program and output is 7

you don’t have to use it there tho, read carefully the instruction:

Add another print() call to print text.lower() and see the output.

2 Likes

yes i understand thanks.

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