Hi! I really don’t get the description of this one. I find my self trying in every single way, searched on the internet and even used ChatGPT without breakthrough. ChatGPT technically solved it, but not on this tasks terms.
but nothing seems to be working. I understand that the answer is supposed to be 10. But can someone please elaborate the question more detailed or just give me an example of a different code at least so that I might understand?
Your code so far
/* User Editable Region */
text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyz'
index = alphabet.find(text[0].lower())
print(index)
shifted = (index+shift)
/* User Editable Region */
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Challenge Information:
Learn String Manipulation by Building a Cipher - Step 16
The different types of brackets in Python generally serve different, distinct purposes:
alphabet = 'abcdefghijklmnopqrstuvwxyz'
print(alphabet[0])
# prints 'a'
The square brackets above are used to access a particular index of the alphabet string.
The parentheses above are used to call the print method. The contents of the parentheses are the arguments/parameters sent to the method, which determine the output.
There are other uses for parentheses, square brackets (and also curly brackets), but you’ll pick them up as you go along.