Sets

# data types - int , float , string , boolean 

# data structures - list , tuple , set , dict 

lst = [] 
tup = () 

fruits = { "apple" , "orange" }

fruits.add("banana")

fruits.add("apple")

fruits.remove("orange")

print(fruits)

Dictionary

# data types - int , float , string , boolean 

# data structures - list , tuple , set , dict 

marks = {
    "english":56 , 
    "maths":67,
    "science":99
}

print(marks)

print(marks["maths"])

marks["social"] = 44 # add new value to dict 

print(marks)

marks.pop("maths")

print(marks)

Nested Dictionary

# data types - int , float , string , boolean 

# data structures - list , tuple , set , dict 

friend1 = {
    "english":56 , 
    "maths":67,
    "science":99
}

friend2 = {
    "english":56 , 
    "maths":77,
    "science":99
}

friend3 = {
    "english":96 , 
    "maths":77,
    "science":99
}

lst = [ friend1 , friend2 , friend3 ]

friends = {
    "Isha":friend1, 
    "friend2":friend2,
    "f3":friend3
}

print(friends)

Set Operations

Untitled

Untitled