Question: Python Tuple Question Ice cream selections Being a lover of ice cream, you decide to write a program ice_cream.py to randomly select ingredients for the

Python Tuple Question

Python Tuple Question Ice cream selections Being a lover of ice cream,

Ice cream selections Being a lover of ice cream, you decide to write a program ice_cream.py to randomly select ingredients for the user. You use a function make_selections(items) that is passed a tuple with options: choices = (('cup', 'cone'), ['chocolate', 'strawberry', 'vanilla', 'pistachio'], ('hot fudge', 'caramel'), ('whipped cream', ")) The function picks a random number of scoops (from 1 to 3), a container (cup or cone), as many flavors as there are scoops, a sauce, and an optional topping. These get returned as a tuple to main, which then prints the selections. Sample runs might look like this: container: cone scoops: 2 flavors: pistachio vanilla sauce: hot fudge container: cup scoops: 3 flavors: chocolate pistachio strawberry sauce: caramel topping: whipped cream

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!