Repository with assignments using the Test Informed Learning with Examples (TILE) method to integrate testing into existing programming courses for free.
Join our LinkedIN Community.
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:
the string is empty
the string has punctuation marks, like ,;.:-¿?+*()!¡
the string ends with a point
the string does not end with a point
the string has numbers
que the string has repeated words, but some are capitalized and
some are not (for example: 'HEllo hello heLlo'
the string has more than 1 space between words
etc.