Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a set, fruits, containing the user inputs: my _ fruit 1 , my _ fruit 2 , and my _ fruit 3 . Add

Define a set, fruits, containing the user inputs: my_fruit1, my_fruit2, and my_fruit3.
Add the user inputs, your_fruit1 and your_fruit2, to fruits.
Add the user input, their_fruit, to fruits.
Add your_fruit1 to fruits.
Remove my_fruit1 from fruits.
Observe the output of each print statement carefully to understand what was done by each task of the program.
Note: For testing purposes, sets are printed using sorted() for comparison, as in the book's examples.
Ex: If the input is:
apple
peach
lemon
apple
pear
plum
the output is:
[ 'apple', 'lemon', 'peach']
['apple', 'lemon', 'peach', 'pear']
['apple', 'lemon', 'peach', 'pear', 'plum']
['apple', 'lemon', 'peach', 'pear', 'plum']
['lemon', 'peach', 'pear', 'plum']
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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions