Extraction II: Spy With a Head Start

Extraction II: Spy With a Head Start

The spy got trickier! Now, the secret message might start later in the string. Extend your function to accept the third parameter start with default value 0.

Take into consideration that you script should be able to solve the previous mission in the series as well.

Input: Three arguments. String (str), positive and non-negative integers (int).

Output: String.

Examples:

assert extraction("aqxczaqsgiunwoorkoaypablnea", 2, 3) == "casinoroyale"
assert extraction("PYTHON", 4, 1) == "YN"
assert extraction("mlhipvzeraqnfddlleetndoiie", 2, 1) == "liveandletdie"
assert extraction("123456789", 3, 2) == "369"

Preconditions:

  • step > 0;
  • start >= 0.