2.10 LAB: Set basics Given the user inputs, complete a program that does the following tasks:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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... 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...
Expert Answer:
Answer rating: 100% (QA)
myFruit1 input myFruit2 input myFruit3 input yourFruit1 input you... View the full answer
Related Book For
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood
Posted Date:
Students also viewed these programming questions
-
At the beginning of 2020 Corp A issued at 96.4 a $10,000,000, 10 year note payable to Corp B at the rate of 6.2%. The debt had an annual coupon due December 31st, and Corp A made the first 2...
-
1.$100,000 is invested for five years at a quarterly compounded rate of 2.25%.What are the proceeds? 2.What is the present value of $10,500 in 2.5 years at 3% monthly compounded discount rate? 3.What...
-
Let f(x) = ax2 + bx + c, where a, b, and c are elements of the field F. Let d EF. Let a2, ai, and ao be the coefficients of the powers of x -- d in the representation f(x) = a2(x d)2 + ai(x d) + ao....
-
Explain the nature of stress at work Describe the health consequences of stressful work Explain how to use hardiness theory to reduce stress List three ways to use Banduras self-efficacy theory to...
-
Confirm that the z-component of orbital angular momentum is a basis for an irreducible representation of A, symmetry in C3v'
-
Given k = 0.4 x 10-3 A/V2 and ID(on) = 3 mA with VGS(on) = 4 V, determine VT.
-
A wing generates a lift \(\mathscr{L}\) when moving through sea-level air with a velocity \(U\). How fast must the wing move through the air at an altitude of \(10,000 \mathrm{~m}\) with the same...
-
Several specific audit procedures are listed below. For each item, identify the type of procedure listed and which of the assertions is being addressed by the procedure. (a) Examine a list of...
-
1 . An employee at Amy's candles has noticed that some order quantities in the two reports presented are different although the order numbers are the same. We normally refer to such data as dirty....
-
In an ideal reheat-regenerative cycle steam enters the high-pressure (H.P.) turbine at 90 bar, 600C. After expansion to 7 bar, some of the steam goes to a direct contact open heater and the balance...
-
1. Walmart buys Timex watches from Timex at $100.00. The markup rate at Walmart is 40%. a. What was the original markup of the watch? b. What is Walmarts Selling Price? c. Some of the watches do not...
-
21. The document necessary to file to form an LLC is called Corporation it's called_ a. Articles of Incorporation, Articles of Corporate Formation b. Articles of Organization, Articles of...
-
What are the key architectural principles underlying the implementation of NoSQL databases, and how do they diverge from traditional relational database models in terms of data storage, querying...
-
Write an evaluator for a program (list of statements + return expression) that evaluates the program and returns the final value of the return expression after the statements in the program are run...
-
Instructions: Using Python and the data set provided, I want you to provide me the code and output that completes the following. That said, I will communicate the data structures of this assignment...
-
Questions: The Schulich School of Business at York University is planning to offer an online part-time MSCM degree for working professionals. The expectations are that (a) the online part-time MSCM...
-
Explain Linux Architecture.
-
Element compound homogeneous mixture (heterogeneous mixture) 4) A piece of gold has a mass of 49.75 g. What should the volume be if it is pure gold? Gold has a density of 19.3 g/cm (3 points) D=m/v...
-
Distinguish between job- order costing and process costing.
-
You are the assistant to the information security director. Your director is interested in hiring a new group of IT staff professionals. Required a. Write a report to your director explaining the...
-
Until recently, Amalgamated Gas employed a batch- processing system for recording the receipt of customer payments. The following narrative and Figure describe the procedures involved in this system....
-
Carry out an Internet search to find more examples of project success and failure. From your search, are there any common themes in each? What are the implications of success and failure in each case?
-
How successful are government contracting arrangements? How do these compare, for instance, with the arrangements BAA had with their suppliers in the construction of T5 at Heathrow (Project...
-
What is the role of brainstorming and how might it be used to greatest effect?
Study smarter with the SolutionInn App