Question: write this as a python code with the write intendation please. CSc 120: Words beginning with Expected Behavior Write a function words_beginning_ with(wordlist, head) that
write this as a python code with the write intendation please.
CSc 120: Words beginning with Expected Behavior Write a function words_beginning_ with(wordlist, head) that behaves as follows. The argument wordlist is a list of strings, while the argument head is a string. words_beginning with (wordlist, head) returns a list consisting of those strings in wordlist that begin with head. If none of the strings in wordlist begin with head, eturns the empty list. The order of list elements in the list returned by the function should match the order of their occurrence in wordlist. Examples In the examples below, wordlist is the list 1. words_beginning_with (wordlist, ev 2. words_beginning_with (wordlist, 'evi') 3. words_beginning_with (wordlist, 'e 4 words_beginning with(wordlist, 'la 5. 'evolve'absolve', 'evil', absent', evidence',lake,ladder', ist' Return value: ['evolve, 'evil', 'evidence Return value: ['evil', 'evidence' Return value:'evolve', evil', evidence' Return value:'lakeladder' words_beginning with (wordlist, ing') Return value: 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
