word1 = “”
for x in word:
word1 += word[::-1]
Only the terms remaining without strike-through are needed for your function to work.
Not only is x doing nothing, the loop never actually runs but breaks on the first iteration.
Interesting mechanics to experiment with, though. There’s variable initialize, loop definition, string concatenation with assignment operator, string slicing and loop interruption, and of course,
return. These are all learned concepts being put into practice, literally. For practice, experimentation is time well spent so long as we learn from it.
The lesson here is to be sure one understands the effect of each component in the code. In so doing one begins to know what effect to expect, and therefore whether said component is needed or not.
Suggest keep experimenting, but without string slicing. Use indices only within a for loop and see what you come up with. Hint:
break will not be needed.