Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2.10 LAB: Set basics Given the user inputs, complete a program that does the following tasks: Define a set, fruits, containing the user inputs
2.10 LAB: Set basics Given the user inputs, complete a program that does the following tasks: Define a set, fruits, containing the user inputs myFruit1, myFruit 2, and my Fruit3. Add the user input theirFruit to fruits. Find the intersection of fruits and your Fruit1 and your Fruit2 Remove my Fruit1 from fruits. Note: For testing purposes, sets are printed using sorted (0) for comparison. Ex: If the input is: apple peach lemon apple pear plum the output is l'apple', 'lemon', 'peach'] ['apple', 'lemon', 'peach', 'plum'] ['apple'] ['lemon', 'peach', 'plum'] 406023.2296122.qx3zay7 LAB ACTIVITY 2.10.1; Set basics 0/2 apple peach lemon apple pear plum the output is I'apple', 'lemon', 'peach'] ['apple', 'lemon', 'peach', 'plum'] ['apple'] ['lemon', 'peach', 'plum'] 4360202295122q-Saay? LAB ACTIVITY 2.10.1: Set basics 1 myFruit1= input() 2 myFruit2 = input () 3 myFruit3 =input() 4 5 your Fruit1 input() 6 your Fruit2 =input() 7 8 theirFruit = input() 9 10 # Define a set, fruits, containing myFruiti, myFruit2, and myFruit3 11 # Your code here 12 print (sorted (fruits)) 13 14 # Add theirFruit to fruits main.py 15 # Your code here 16 print (sorted (fruits)) 17 18 # Find the intersection of fruits and yourFruit1 and yourFruit2 19 fruitsInter = # Your code here 20 print (sorted (fruits Inter)) 21 22 # Remove myFruit1 from fruits 23 # Your code here 24 print (sorted (fruits)) 0/2 Load default template...
Step by Step Solution
★★★★★
3.39 Rating (155 Votes )
There are 3 Steps involved in it
Step: 1
myFruit1 input myFruit2 input myFruit3 input yourFruit1 input you...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started