Feb-06-2021, 03:41 PM
Hi,
I have a list of names, such as: words=['cat', dog', 'lion','snake', 'fox']
I then want to write a function that looks at the words that start with c and s and validate that through an assertion as follow:
I have a list of names, such as: words=['cat', dog', 'lion','snake', 'fox']
I then want to write a function that looks at the words that start with c and s and validate that through an assertion as follow:
def get_words_that_start_with(letter): return assertion('8a', get_words_that_start_with('c'), ['cat']) assertion('8b', get_words_that_start_with('s'), ['snake'])when I run my assertion, i should get correct because my function would recognize the word that start with c and s