0% found this document useful (0 votes)
13 views1 page

Set Task Sheet

The document outlines a set of tasks related to set operations in Python, including finding differences and intersections between two sets of names: engineers and phd_holders. It also includes questions about properties of sets, creating empty sets, calculating sums and averages, and differentiating between various data structures like lists, tuples, sets, and dictionaries. Additionally, it touches on concepts like frozen sets and nested sets, as well as subset and superset relationships.

Uploaded by

Muhammad Yasir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Set Task Sheet

The document outlines a set of tasks related to set operations in Python, including finding differences and intersections between two sets of names: engineers and phd_holders. It also includes questions about properties of sets, creating empty sets, calculating sums and averages, and differentiating between various data structures like lists, tuples, sets, and dictionaries. Additionally, it touches on concepts like frozen sets and nested sets, as well as subset and superset relationships.

Uploaded by

Muhammad Yasir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Address: WsCube Tech, Laxmi Tower, Bhaskar Circle, Jodhpur, Rajasthan, India

Contact Us at: +919269698122, +919024244886. Mail us at: info@[Link]

Set Tasksheet

Q.1 You have been given 2 sets named engineers, phd_holders.


engineers = {"Ram","Shyam", "Radha", "Mohan", "Geeta", "Sunita"}
phd_holders = {"Krishna", "Ram", "Rakesh", "Mohan", "Annirudh","Geeta"}
solve all below mentioned condition using set methods
i) Find out a set of those who are engineers but not phd_holders
ii) Find out a set of those who are phd_holders but not engineers
iii)Find out a set of those who either phd_holders or engineers
iv) Find out a set of those who are both phd_holders and engineers
v) Generate a new set in which every engineer and phd_holder is present only once.

Q. 2 Do the above question without using set methods.


Q. 3 What are properties of sets and how you can create an empty set.
Q.4 Write a program to find sum, average of all elements inside a set.
Q.5 What is frozen set, explain with an example.
Q.6 Differentiate among list, tuple, set and dictionary property wise.
Q.7 Can we make a nested set?
Q.8 What do you mean by sub set and super set. Is A sub set of B?
A ={ 1, 2, 3, 4, 5}
B = {2, 3}

You might also like