Page 1 of 1

In this problem, you should write one function named two_words. This function should accept one parameter, which you can

Posted: Tue Jul 12, 2022 8:28 am
by answerhappygod
In this problem, you should write one function named two_words.This function should accept one parameter, which you can assumewill 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 wouldcome first and last in the alphabet from the list of words. Thefunction should return these two words concatenated together, withone space in-between. The alphabetically0earlier word should befirst.
A few examples:
The function call two_words(['tree', 'forest', 'antelope','zebra'])
should return the string 'antelope zebra'.
The function call two_words(['zoo', 'champion', 'fetch','those', 'lemurs'])
should return the string 'champion zoo'.