Your question is Python Coding: Primes and Counts. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
A GlobalLogic data-quality pipeline receives a batch of integers and a compact status string. Implement one Python function that identifies which integers are prime and counts how many times each character appears in the string.
Return a dictionary with two keys:
prime_flags: a list of booleans aligned with the input integer array. A value is true only when the corresponding integer is prime.character_counts: a dictionary mapping each distinct character to its frequency. Preserve the order in which characters first appear.Treat all integers less than 2 as non-prime. The input string contains lowercase English letters and is non-empty.
numbers, a list of integers, and text, a non-empty string.prime_flags: list[bool] and character_counts: dict[str, int].1 with no positive divisors other than 1 and itself.def classify_numbers_and_count_characters(numbers, text):