Question
code should be written in python please Write a module to process strings and lists in python. The module will ask the user to enter
code should be written in python please
Write a module to process strings and lists in python. The module will ask the user to enter six words, then it will process the input using a collection data type such as list, a tuple, or a dictionary. The program should have several, clearly-defined functions that are separate from the main program.
The first function should take the user's input and print it out in alphabetical order. The second function should split the input into two lists of three words each, and the third function should combine the input into pairs of words. The program should run in a way that is similar to this:
>> Please enter five words, separated by space:
>> pomegranate apple pear coconut banana kiwi
>> Here are your words in alphabetical order:
>> apple banana coconut kiwi pear pomegranate
>> Here is your input, split into two lists:
>> list1: pomegranate, apple, pear
>> list2: coconut, banana, kiwi
>> Here is your input, divided into pairs:
>> pair1: pomegranate, coconut
>> pair2: apple, banana
>> pair3: pear, kiwi
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started