Learn String Manipulation by Building a Cipher - Step 5

Tell us what’s happening:

I know the answer is “print(text[6])” But it asked me to print index 6 instead of printing “text” so I don’t understand how

Your code so far


# User Editable Region

text = 'Hello World'
print(text[6])

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

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 5

it asks to print the character of text at index 6, so you get text and then you get the character at index 6 with bracket notation

Alright thanks but is there a way to make it without printing text

to pass the step? no, it asks to print

you can access the character in any context tho
like:

sixth_character = text[6]

text is the variable of the full string, the instructions ask you to print 1 character, not the full string of text. Do you see the difference?

You aren’t printing text, you are just printing part of it.

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