Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3 : Write a function called first _ word that takes a list of character strings as input and returns the first element of

Problem 3: Write a function called first_word that takes a list of character strings as input and returns the first element of the list in alphabetical order. For
example, your function should work like this:
students =['Mary', 'Zelda', 'Jimmy', 'Jack', 'Bartholomew', 'Gertrude']
first_word(students)
'Bartholomew' # The result
Hint: You'll need to first sort your list in the function to accomplish this, then identify the first element. Within a function, it is a good idea to use multiple lines of
code to separate out the different steps. Just make sure all the code that belongs to the function is indented!
After you've written the function, run it by supplying the list teams to your function as an argument to test it.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Access Patterns Database Interactions In Object Oriented Applications

Authors: Clifton Nock

1st Edition

0321555627, 978-0321555625

More Books

Students also viewed these Databases questions