← Back to challenges

Word Riddles

PythonHardstringslanguage_fundamentals

Instructions

What does the word LFAND represent? It represents the word Finland, because F is in LAND!

Create a function which replicates this to create brand new original word riddles! For the purposes of this challenge, take the string of letters before the word "in", and insert it into the 2nd letter position of the word formed after the word "in".

See the examples below for further clarity :)

Examples

make_word_riddle("Finland") ➞ "LFAND"

make_word_riddle("dinner") ➞ "NDER"

make_word_riddle("tkinter") ➞ "TTKER"

make_word_riddle("STRINGS") ➞ "GSTRS"

Notes

  • All words given will contain only one occurence of "in" (so no occurences of the words Insulin, Infinity, etc).
  • There will be no examples of Interest, Pin, or Ping, etc... as there is no clear way to insert the strings into one another.
  • Return in all CAPS.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Converting One Binary String to Another