Test Informed Learning with Examples

Logo

Repository with assignments using the Test Informed Learning with Examples (TILE) method to integrate testing into existing programming courses for free.

Menu

LinkedIN Community

Join our LinkedIN Community.

Split a string into a list of unique words

Design a function (mySplit) that gets a string and returns a list of all its words in lowercase. The returned list must not contain repeating words. You can’t use Python’s default split. For example, with the string:

>>> mySplit('A phrase made up of words. Another phrase with other words.')
    ['a', 'phrase', 'made', 'up', 'of', 'words', 'another', 'with', 'other']
>>> mySplit('Hi! Helloooo HI')
    ['hi', 'helloooo']

To design your set of tests that you have to run automatically with pytest, think about these cases: