Learn String Manipulation by Building a Cipher - Step 16

Tell us what’s happening:

what should be the final code here i am stuck on this problem for like 30 min lmao
6

Your code so far


# User Editable Region

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



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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 16

reset the code, lower for now goes only in a print statement

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

Also you need to call lower() when you use it

Hi there and welcome to our community!

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

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

You haven’t used the specified print command. Just do exactly what the instructions above tell you to do.

what am i doing wrong here

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

index = alphabet.find(text[0].lower())

print( index )

print (index.lower)

what am i doing wrong here

alphabet = ‘abcdefghijklmnopqrstuvwxyz’

index = alphabet.find(text[0].lower())

print( index )

print (index.lower)

The goal here is to print the results of calling the lower() method on the text variable.

index = alphabet.find(text[0].lower())

Here you’ve called .lower() on text[0] but the instructions don’t ask for that so you can remove that or better, reset the step.

print(index)

Here, you print index. After that, you should print text.lower() using the same syntax.

print (index.lower)
  • You need to have the brackets at the end of lower to call the function lower().
  • You need to call the function on text, not index.
  • Don’t have a space after print, format it just like the previous line where you print index.

sorry for being this dumb

text = 'Hello World'

shift = 3

alphabet = 'abcdefghijklmnopqrstuvwxyz'

index = alphabet.find(text[0])

print(index)

print (index text.lower() )

what is wrong here

Hi @haqkhalid99

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

The instructions here do not ask you to place a print call on index text.lower()

Happy coding

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

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