Question: 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: myfruit myfruit and myfruit
Add the user inputs, yourfruit and yourfruit to fruits.
Add the user input, theirfruit, to fruits.
Add yourfruit to fruits.
Remove myfruit 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'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
