Merge dicts summing values
Write a function that merges two dictionaries by summing values for duplicated keys.
Are two lists the same multiset
Write a function that checks if two lists contain the same elements with the same multiplicities, ignoring order.
Mode of a list via counting
Implement a function that returns the mode of a list, resolving ties by the element that appears first.
Values that appear once
Return a list of numbers that appear exactly once in the input list, in original order.
Pair with difference K
Count unordered index pairs with absolute difference exactly K, handling duplicates correctly.
Set intersection size
Count how many distinct values appear in both of two given lists.
Count Pairs with Sum
Implement a function that counts the number of distinct pairs in a list summing to a target.
Ransom Note Builder
Given two strings, determine if the ransom note can be formed from the words in the magazine.
Showing 8 challenges · Dicts & Sets
Dicts & Sets — Python coding challenges
What you will find here
This page lists dicts & sets challenges — real Python problems you solve in the browser IDE with instant test feedback. Each challenge includes a clear brief, starter code, and automated checks.
Challenges vs tutorials and quizzes
Challenges test what you can build under constraints. For guided teaching, use our Python tutorials. For quick checks, try quizzes or copy snippets from code samples.