Automated grading of homework assignments and tests
- fork this repository
- solve the task
- commit with proper message
Given a dictionary, Return first item value.
Example 1:
Input: {'a': 1, 'b': 2}
Output: 1
Given a dictionary, Return last item value.
Example 1:
Input: {'a': 1, 'b': 2}
Output: 2
Convert two lists into a dictionary
Example 1:
Input: key = [1, 2, 3] value = ["one", "two", "three"]
Output: {1: "one", 2: "two", 3: "three"}
Constraints:
- len(key) == len(value)
Given a function that takes a string and calculates the number of letters and digits within it.
- Tests contain only alphanumeric characters.
- Spaces are not letters.
- All tests contain valid strings.
Example 1:
Input: txt = "Hello World"
Output: { "LETTERS": 10, "DIGITS": 0 }
Example 2:
Input: txt = "python foundations 2022"
Output: {'LETTERS': 17, 'DIGITS': 4}
Constraints:
- 0 <= len(txt) <= 10^5
Given a dictionary containing the names and ages of a group of people, return the name of the oldest person.
Example 1:
Input: people = {"Javohir": 22, "Sharof": 23, "Tolib": 34, "Rustam": 16}
Output: "Tolib"
Constraints:
- 0 <= len(people) <= 10^5
Given a list of cities names, Return dictionary with keys ordered by city name.
Example 1:
Input: cities = ["Bukhara", "Khiva", "Namangan", "Samarkand", "Tashkent"]
Output: {0: "Bukhara", 1: "Khiva", 2: "Namangan", 3: "Samarkand", 4: "Tashkent"}
Constraints:
- 0 <= len(cities) <= 10^5
- don't copy other solutions or any solution
- don't remove comments