What Your Python Program Should Do: Alex will go first To begin with, first print "Hi Alex, what do you need at the store?" Then, let Alex (i.e. the user) enter items that he wants to buy, one by one. Store each item in a list called alex. When Alex is done with his list, he should be able to type in "x" (without quotes) to tell your program that he is done adding items. Next, it's Ben's turn Without quitting your program, print "Thanks, Alex. Your turn, Ben!" Then, let Ben (i.e. the same user) enter items that he wants to buy, one by one. Store each item in a list called ben. It should contain everything from Alex's list, plus the extra items that Ben wants. When Ben is done with his list, he should be able to type in "x" (without quotes) to tell your program that he is done adding items. Print the Lists and Extra Information Print each item in Alex's list, one by one, each one on a new line. Print each item in Ben's list, one by one, each one on a new line. Find the longest item name in Alex's list, and print what it is. Find the shortest item name in Ben's list, and print what it is.

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter19: Probabilistic Dynamic Programming
Section19.4: Further Examples Of Probabilistic Dynamic Programming Formulations
Problem 7P
icon
Related questions
Question
Case Scenario:
Alex and his friend Ben are roommates. This week, it's Alex's turn to do the
grocery shopping for both of them. He needs your help in making two
shopping lists one for him and one for Ben. Ben always wants the same
things that Alex wants, and then a few extra items. Alex needs a list of things
to buy for himself and another list of things to buy for Ben.
Transcribed Image Text:Case Scenario: Alex and his friend Ben are roommates. This week, it's Alex's turn to do the grocery shopping for both of them. He needs your help in making two shopping lists one for him and one for Ben. Ben always wants the same things that Alex wants, and then a few extra items. Alex needs a list of things to buy for himself and another list of things to buy for Ben.
What Your Python Program Should Do:
Alex will go first
To begin with, first print “Hi Alex, what do you need at the store?”
Then, let Alex (i.e. the user) enter items that he wants to buy, one by one.
Store each item in a list called alex.
When Alex is done with his list, he should be able to type in "x" (without quotes)
to tell your program that he is done adding items.
Next, it's Ben's turn
Without quitting your program, print “Thanks, Alex. Your turn, Ben!”
Then, let Ben (i.e. the same user) enter items that he wants to buy, one by one.
Store each item in a list called ben. It should contain everything from Alex's list,
plus the extra items that Ben wants.
When Ben is done with his list, he should be able to type in "x" (without quotes) to
tell your program that he is done adding items.
Print the Lists and Extra Information
Print each item in Alex's list, one by one, each one on a new line.
Print each item in Ben's list, one by one, each one on a new line.
Find the longest item name in Alex's list, and print what it is.
Find the shortest item name in Ben's list, and print what it is.
Transcribed Image Text:What Your Python Program Should Do: Alex will go first To begin with, first print “Hi Alex, what do you need at the store?” Then, let Alex (i.e. the user) enter items that he wants to buy, one by one. Store each item in a list called alex. When Alex is done with his list, he should be able to type in "x" (without quotes) to tell your program that he is done adding items. Next, it's Ben's turn Without quitting your program, print “Thanks, Alex. Your turn, Ben!” Then, let Ben (i.e. the same user) enter items that he wants to buy, one by one. Store each item in a list called ben. It should contain everything from Alex's list, plus the extra items that Ben wants. When Ben is done with his list, he should be able to type in "x" (without quotes) to tell your program that he is done adding items. Print the Lists and Extra Information Print each item in Alex's list, one by one, each one on a new line. Print each item in Ben's list, one by one, each one on a new line. Find the longest item name in Alex's list, and print what it is. Find the shortest item name in Ben's list, and print what it is.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole