Automated grading of homework assignments and tests
- fork this repository
- solve the task
- commit with proper message
Return the number of users with a given job
Example 1:
Input: ([{'name': 'John', 'job': 'Developer'}, {'name': 'Mary', 'job': 'Developer'}],"Developer")
Output: 2Constraints:
- 0 <= len(data) <= 10^5
- 0 <= len(data) <= 10^5
Return the number of users with a given age.
Example 1:
Input: ([{'name': 'John', 'age': 27},{'name':'Mary', 'age': 42}],27)
Output: 1Constraints:
- 0 <= len(data) <= 10^5
- 0 <= age <= 10^5
Return a list of all keys in a dictionary that are integers.
Example 1:
Input: {'a': 1, 3: 2, 'c': 3,10:'a'}
Output: [3, 10]Constraints:
- 0 <= len(data) <= 10^5
Return the sum of the length of all values in a dictionary.
Example 1:
Input: {'a': 'abc', 'b': 'def', 'c': 'ghi'}
Output: 9Example 2:
Input: {1: "Khiva", 2: "Namangan", 3: "Samarkand", 4: "Tashkent"}
Output: 30Constraints:
- 0 <= len(data) <= 10^5
Return the maximum key in a dictionary.
Example 1:
Input: {1:'a', 2:'b', 3: 'c'}
Output: 3- 0 <= len(data) <= 10^5
Return the maximum value in a dictionary.
Example 1:
Input: {'a': 1, 'b': 2, "c" : 3}
Output: 3Constraints:
- 0 <= len(data) <= 10^5
Return the country with the least users
Example 1:
Input: [{'name': 'John', 'country': 'USA'}, {'name': 'Mary', 'country': 'UK'}]
Output: 'UK'Constraints:
- 0 <= len(data) <= 10^5
Return the country with the most users with a given age
Example 1:
Input: ([{'name': 'John', 'country': 'USA', 'age': 27}, {'name': 'Mary', 'country': 'UK', 'age': 42}],27)
Output: 'USA'Constraints:
- 0 <= len(data) <= 10^5
Return the country with the most users.
Example 1:
Input:[{'name': 'John', 'country': 'USA'}, {'name': 'Mary', 'country': 'UK'}]
Output: "USA"Constraints:
- 0 <= len(data) <= 10^5
Return the name of the user with the maximum age in a dictionary.
Example 1:
Input: [{'name': 'John', 'age': 27}, {'name': 'Mary', 'age': 42}]
Output: 'Mary'Constraints:
- 0 <= len(data) <= 10^5
Return the name of the user with the minimum age in a dictionary.
Example 1:
Input: [{'name': 'John', 'age': 27}, {'name': 'Mary', 'age': 42}]
Output: 'John'Constraints:
- 0 <= len(data) <= 10^5
Return the country of a user with a given name.
Example 1:
Input: ([{'name': 'John', 'country': 'USA'}, {'name': 'Mary', 'country': 'UK'}],"John")
Output: 'USA'Constraints:
- 0 <= len(data) <= 10^5
- 0 <= len(name) <= 10^5
Return a list of users with a given age range and country
Example 1:
Input: ([{'name': 'John', 'age': 27}, {'name': 'Mary', 'age': 42}],20,30,"USA")
Output: ['John']Constraints:
- 0 <= len(data) <= 10^5
- 0 <= max_age <= 10^5
- 0 <= min_age <= 10^5
- 0 <= len(country) <= 10^5
Return a list of users with a given age range
Example 1:
Input: ([{'name': 'John', 'age': 27}, {'name': 'Mary', 'age': 42}],20,30)
Output: ['John']Constraints:
- 0 <= len(data) <= 10^5
- 0 <= max_age <= 10^5
- 0 <= min_age <= 10^5
Return a list of users with a given age
Example 1:
Input: ([{'name': 'John', 'age': 27}, {'name': 'Mary', 'age': 42}],27)
Output: ['John']Constraints:
- 0 <= len(data) <= 10^5
- 0 <= age <= 10^5
Return a list of users with a given country
Example 1:
Input: ([{'name': 'John', 'country': 'USA'}, {'name': 'Mary', 'country': 'UK'}],"USA")
Output: ["John"]Constraints:
- 0 <= len(data) <= 10^5
- 0 <= len(name) <= 10^5
Return the sum of all age values in a dictionary.
Example 1:
Input: [{'name': 'John', 'age': 27}, {'name': 'Mary', 'age': 42}]
Output: 69Constraints:
- 0 <= len(data) <= 10^5
Return the sum of all values in a dictionary.
Example 1:
Input: {'a': 1, 'b': 2, 'c': 3}
Output: 6Constraints:
- 0 <= len(data) <= 10^5
Return the sum of all even values in a dictionary.
Example 1:
Input: {'a': 1, 'b': 2, 'c': 3}
Output: 2Constraints:
- 0 <= len(data) <= 10^5
Return the sum of all float values in dictionary.
Example 1:
Input: {'a': 1, 'b' : 2.5, 'c': 3.0}
Output: 5.5Constraints:
- 0 <= len(data) <= 10^5
- don't copy other solutions or any solution
- don't remove comments