First, we are creating two variables “text” and “shift”. Then, we are creating a variable named “alphabet” and “index”.
In “index” variable we are trying to find the index/location of the “text[0]” (text variable) ie… the first element of the “Hello World” (h) in the alphabet variable using “alphabet.find()”. We use the lower() to convert it to the lower case.
Then we print the “index” variable. Now, In step-16 we are using the “+” operator to find the letter at index, “index + shift” which is “h + 3”.
So, we are creating a new var named “shifted” and assign it to “index variable + shift variable” along with the alphabet variable. Try to include the alphabet var with index + shift.
Hint:
hint
word = "kite"
shift = 2
text = "flyskyhigh"
index = text.find(word[0])
print(index) # index = 4
shifted = text[index + shift] # k + 2 which is h we include the text[]
print(shifted)
You can check for solution here:
REDACTED BY MOD
PS: Sorry for such a long explanation. Happy Coding!
It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.
We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.
THANK YOU SO MUCH! LITERALLY I WAS STUCK LIKE FOR 30 MINS! But seriously, you are the man thank you for helping me and others out, we really appreciate your help