Question: Problem 5 : Set Operations - Union Given two sets = { 1 , 2 , 3 } and = { 3 , 4 ,
Problem : Set Operations Union
Given two sets and find the union of these two sets and print the result.
Problem : Set Operations Intersection
For the following sets 'set and 'set determine the intersection and print the shared elements.
Problem : Dictionary Manipulations
Create a dictionary named 'fruitprices with the following fruit names as keys and their corresponding prices as values:
Apple:
Banana:
Cherry:
Then, update the price of the cherry to and add another entry for grapes with a price of
Problem : Set Operations
Create two sets, 'setone' with numbers and 'settwo' with numbers Find the union and intersection of these two sets.
Problem : Adding to a Dictionary
Given a dictionary with student names as keys and their grades as values:
studentgrades Alice: "Bob": "Charlie":
Add a new student "Diana" with a grade of and then retrieve the grade for "Alice".
Problem : Removing from a Dictionary
Create a dictionary for a small office where the keys are employee names and the values are their phone extension numbers. Include at least three employees. Then, remove one employee from the dictionary and add a new employee with a different extension.
Problem : Dictionary Manipulations
Given a set s with elements perform the following tasks:
Remove element from s
Add a new element to s
Problem : Dictionary Manipulations
Construct a dictionary 'inventory' where the keys are item names and the values are quantities. Start with 'Pens' with a quantity of and 'Notebooks' with a quantity of Then update 'Pens' to and add 'Markers' with a quantity of
Problem : Determining Set Differences
Create a set 'primenumbers' with thefirst five prime numbers. Then, create another set 'fibonaccinumbers' with the first five numbers in the Fibonacci sequence. Find the symmetric difference between the two sets. Note: you need to look up these series to determine what to put in the sets.
Problem : Finding Differences Between Sets
Create two sets, 'evennumbers' with numbers and 'oddnumbers' with numbers Find the difference between 'evennumbers and 'oddnumbers'.
Problem : Working with Dictionaries
Create a dictionary 'reverselookup' where you will store numbers as keys and their word forms as values eg:'One' Start with numbers to Then, add another entry for the number and its word form. Access the word form of number
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
