Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN PYTHON. ASAP i have posted 2 pictures of the same problem for better viewing Part 6: Sets In{1611timbet={1,2,3,4,3,6,6,6,4,6,6,6,7,7,4,8,1,7,7}0,2,1161+(1,2,3,4,5,6,7,1,9) You ean alibo add or remeve

IN PYTHON. ASAP
image text in transcribed
i have posted 2 pictures of the same problem for better viewing
image text in transcribed
image text in transcribed
Part 6: Sets In{1611timbet={1,2,3,4,3,6,6,6,4,6,6,6,7,7,4,8,1,7,7}0,2,1161+(1,2,3,4,5,6,7,1,9) You ean alibo add or remeve values Much like in state you ean also do union or intersection operatione on aete Dut{20}1(0,2,4,6,1,10,12,14,26,18} In 17111 print (wunset.1ntersection(nunseta) {2,4,6,8,16} In 122 If pointedusiet a sansett) {2,4,6,6,16} In [23]j print (auablet,union (numbect) (0,1,2,4,5,6,7,1,9,10,12,14,14,10} In {25} : princtnurset 1 numset2\} (0,1,2,4,5,5,7,1,9,16,12,14,16,18) Figirs eut how to une the range0 function above to make a set celed "atikumbere" with nuenters hoen 1 at 1a fretubivi) Rn: 11 Now make angther set with the ravge0 hunction to make a set called "everitumbere' wath even mumbers thoen of hicugh 19 Anctuskei Tn1/16 Add the number 20 to the first set. In I I1 Hamove of frem the secend set. in If 1i Caiculate the intersection of these sats Calculate the urben of Rhese sets Part 6: Sets Sets are unique and can only contain unique values. They are declared using curfy braces as can be seen below In [16]:numset=numbet Out [16]1{1,2,3,3,4,5,6,6,6,6,6,6,6,7,7,8,8,8,8,9} You can also add or remove values Much like in stats you can also do union or intersection operations on sets In (251 ti print (buanset | nunset2) {0,1,2,4,5,6,7,3,9,10,12,14,16,10} Figure out how to use the range0 tunction above to make a set called "allNurnbers" with numbers from 1 to 19 (inclusive) In 111 Now make another set with the rangeo function to make a set called "evenNumbers" with even numbers from o through 10 (inclusivel to 1 is Flgure out how to use the range0 function above to make a set called "allNumbers" with numbers from 1 to 19 (inclusive) InI11 Now make another set with the range0 function to make a set called "evenNumbera" with oven numbers from 0 through 10 (inclusive) In11 Add the number 20 to the first set In111 Remove 0 from the second set In11t Calculate the intersection of these sets In(11 Calculate the union of these sete inf(1)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions