Question: 4 . Sets in python For the following questions you have to provide the code and the output of your code. a ) Write a

4. Sets in python
For the following questions you have to provide the code and the output of your code.
a) Write a code to generate the set setA of positive integers less than 1000 which last two digits are divisible by 43(example 186 is in the set because 86 is divisible by 43)
b) Write a code to generate the set setB of positive integers less than 1000 which first two digits are divisible by 24(example 725 is in the set because 72 is divisible by 24)
c) Write a code to compute setC the union of setA and setB
d) Write a code to compute setD the intersection of setA and setB
e) Check using a python code that \(\mid \) setA \(|+|\operatorname{setB}|=|\) setC \(|+|\) setD \(\mid \)
f) Write a function cartesian that has two sets as input and returns their cartesian product as output (without importing any library)!
g) Use your function to find the cartesian product between setD and the set of colors on a traffic light.
4 . Sets in python For the following questions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!