Amazing Alliteration

Published by Helen Yu in

Alliteration refers to a sequence of words that begin with the same letter. For this exercise, a sentence is correctly alliterated if all words strictly greater than 3 characters begin with the same letter.

Examples

alliteration_correct("She swam to the shore.") ➞ true
# All words >= 4 letters long begins with "s"

alliteration_correct("Maybel manages money well.") ➞ false
# "well" does not begin with an "m"

alliteration_correct("He helps harness happiness.") ➞ true

alliteration_correct("There are many animals.") ➞ false

Notes

  • Check the resources tab for a better explanation of alliteration.
  • This is to allow for filler words such as "the", "to", "a", etc. - so words with three or fewer characters are not counted.
  • Punctuation does not count as part of a word's length.
Watch a quick demo on how Edabit works.