0% found this document useful (0 votes)
1 views

Assignment Ds Aug5

Uploaded by

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

Assignment Ds Aug5

Uploaded by

voodbinod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Exercise 1: Create a list by picking an odd-

index items from the first list and even index


items from the second

Exercise 2: Remove and add item in a list


Use the list methods, pop(), insert() and append()

Exercise 3: Count the occurrence of each


element from a list

Exercise 4: Create a Python set such that it


shows the element from both lists in a pair

Exercise 5: Find the intersection (common) of


two sets and remove those elements from
the first set

Exercise 6: Checks if one set is a subset or


superset of another set. If found, delete all
elements from that set

Exercise 7: Iterate a given list and check if a


given element exists as a key’s value in a
dictionary. If not, delete it from the list

Exercise 8: Get all values from the dictionary


and add them to a list but don’t add
duplicates
Exercise 9: Remove duplicates from a list and
create a tuple and find the minimum and
maximum number

Excercise 10: Given a Python list, write a


program to remove all occurrences of item
20.
Given:

list1 = [5, 20, 15, 20, 25, 50, 20]

Expected output:

[5, 15, 25, 50]

You might also like