Between Words

Published by Helen Yu in

Write a function that takes three string arguments (first, last, and word) and returns True if word is found between first and last in the list, otherwise False.

Examples

is_between("apple", "banana", "azure") ➞ True

is_between("monk", "monument", "monkey") ➞ True

is_between("bookend", "boolean", "boost") ➞ False

Notes

  • All letters will be in lowercase.
  • All three words will be different.
  • Remember that the string word is in the middle.
Watch a quick demo on how Edabit works.