Question: Python: Set my _ favorites contains 'cobalt', 'ivory', and 'red'. Set your _ favorites contains three strings read from input. Assign likeable _ colors with

Python: Set my_favorites contains 'cobalt', 'ivory', and 'red'. Set your_favorites contains three strings read from input. Assign likeable_colors with the union of my_favorites and your_favorites.
Ex: If the input is:
cobalt
ivory
purple
then the output is:
My favorite colors: ['cobalt', 'ivory', 'red']
Your favorite colors: ['cobalt', 'ivory', 'purple']
Likeable colors: ['cobalt', 'ivory', 'purple', 'red']
Note: Because sets are unordered, the sets are printed using the sorted() function here for comparison.
my_favorites ={'cobalt', 'ivory', 'red'}
your_favorites ={input(), input(), input()}

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 Databases Questions!