Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 1.13 KB

File metadata and controls

19 lines (14 loc) · 1.13 KB

Problem solving session No. 3

Problem set 1

  1. Write a Python function to get symmetric tuples from a list of tuples. Each tuple consists of two elements, i.e. they are in the form of $(x, y)$. A tuple $(x, y)$ is symmetric if there is another (y, x) tuple in the list.
  2. Write a Python function that assigns the frequency to each tuple in a given list as a last tuple element.
  3. Write a Python function to convert a binary tuple to an integer.
  4. Write a Python function to generate a list of tuples for a standard card deck.
  5. Write a Python function to find the union and intersection of two tuples (with/without preserving the order).

Problem set 2

  1. Write a Python function to get all the dictionary keys whose corresponding values are equal to the given value.
  2. Write a Python function to check if two sequences are anagrams or not.
  3. Write a Python function to create a dictionary in which the values map to the keys that they belong to in a given dictionary.
  4. Write a Python function to remove duplicate values from a dictionary.
  5. Write a Python function to get the common elements from two dictionaries.