In this problem, you should write one function named two_words
.
This function should accept one parameter, which you can assume will be a list with one or more strings in it, each being a word.
Using a for-loop, the function should determine the word that would come first and last in the alphabet from the list of words.
The function should return these two words concatenated together, with one space in-between.
The alphabetically0earlier word should be first.
A few examples:
two_words(['tree', 'forest', 'antelope', 'zebra'])
should return the string 'antelope zebra'
.two_words(['zoo', 'champion', 'fetch', 'those', 'lemurs'])
should return the string 'champion zoo'
.Make sure to include only the one function in your file.
The gradescope tests will call the functions to test them.
Name the program prep21.py
.
Make sure that gradescope gives you the points for passing the test case.