Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1 - a set of numbers between 10 and 20 - another set of numbers between 5 and 15 -Output to screen the difference

Task 1
- a set of numbers between 10 and 20
- another set of numbers between 5 and 15
-Output to screen the difference of the two sets
-Output to screen the common numbers of the two sets
-Iterate through each value of sets one and two

 

Task 2
 one list with 3 unique string values
 another list with 3 unique integer values
 a set that contains the 6 values of the lists create above
Add any value to the SET created.
Remove any string value of the set created
Create a new set that takes any 3 values of the first set (hint: conversion & slicing or iteration & adding)
Output the values that are not in both sets (a method exists)
Using 1 for loop, output all the values of both sets


Task 3
 a dictionary of 3 key-value pairs
GET the value of one of the keys
Remove one of the keys
Output the dictionary using a loop in the format of key = value

 

Task 4
 one list with 3 unique string values
 another list with 3 unique double values
 a dictionary where the keys are the string values and the values are the double values

Task 5
You are a store own
 a dictionary of your inventory
    The inventory should have 3 categories
        Each category should have 2 items
You need to select a vendor
 a dictionary of the vendor's inventory
    The inventory should have 3 categories
        Each category should have 2 items
Output the items that YOU have but the VENDOR does not have
Output the items that BOTH YOU and the VENDOR have
Ask the user for an item
Determine if the item is in STOCK (you have it)
Determine if vendor carries the item (vendor has it)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Task 1 To solve Task 1 you can use Python code like the following python set1 setrange10 21 set2 setrange5 16 difference set1 set2 commonnumbers set1intersectionset2 printDifference of the two sets di... 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

Practical Introduction To Data Structures And Algorithm Analysis Java Edition

Authors: Clifford A. Shaffer

1st Edition

0136609112, 978-0136609117

More Books

Students also viewed these Programming questions