Extend the custom job list feature by allowing the user to specify how many of each job title they want.
The generator should handle mismatches between the total requested count and the actual sum of defined counts.
Parameters:
job_title_counts: dict[str, int] – job title as key, count as value
total_amount: int – total number of jobs to generate (optional)
Logic:
- If
sum(counts) > total_amount → trim the extra titles to match total
- If
sum(counts) < total_amount → fill missing spots with random titles from the keys
- If equal → return the exact list
Extend the custom job list feature by allowing the user to specify how many of each job title they want.
The generator should handle mismatches between the total requested count and the actual sum of defined counts.
Parameters:
job_title_counts: dict[str, int]– job title as key, count as valuetotal_amount: int– total number of jobs to generate (optional)Logic:
sum(counts) > total_amount→ trim the extra titles to match totalsum(counts) < total_amount→ fill missing spots with random titles from the keys