Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's the Python function `process` that takes data like the provided example as an argument and returns a dictionary where the keys are the queries (e.g., A361, 32B57) and the values are the total number of times each query is present:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(': ')[1]) result[current_query] += count return result |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) |
1 | {'A361': 174, '32B57': 106} |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(': ')[1]) result[current_query] += count return result data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(': ')[1]) result[current_query] += count return result data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) answer = process('QUERY A361\nFound at: 160392127418\nNumber of times present: 4\n\n\nFound at: 150158692866\nNumber of times present: 4\n\n\nFound at: 122340445248\nNumber of times present: 17\n\n\nFound at: 137248651778\nNumber of times present: 84\n\n\nFound at: 131891981708\nNumber of times present: 66\n\n\nQUERY 32B57\nFound at: 194561247604\nNumber of times present: 4\n\n\nFound at: 82888490886\nNumber of times present: 3\n\n\nFound at: 115836535414\nNumber of times present: 19\n\n\nFound at: 79615924948\nNumber of times present: 81\n') expected = {'A361': 175, '32B57': 107} assert answer == expected, f'Wrong answer; got {answer} instead of {expected}' print('All tests passed') |
{'A361': 174, '32B57': 106}
All tests passed
Testing if the previous output contains the string All tests passed
: True
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's a Python function called `process` that takes the data as an argument and returns a dictionary where the keys are the queries (e.g., A361, 32B57) and the values are the total number of times each query is present:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(': ')[1]) result[current_query] += count return result |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) |
1 | {'A361': 174, '32B57': 106} |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(': ')[1]) result[current_query] += count return result data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' if __name__ == '__main__': result = process(data) print(result) |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(': ')[1]) result[current_query] += count return result data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' if __name__ == '__main__': result = process(data) print(result) answer = process('QUERY A361\nFound at: 160392127418\nNumber of times present: 4\n\n\nFound at: 150158692866\nNumber of times present: 4\n\n\nFound at: 122340445248\nNumber of times present: 17\n\n\nFound at: 137248651778\nNumber of times present: 84\n\n\nFound at: 131891981708\nNumber of times present: 66\n\n\nQUERY 32B57\nFound at: 194561247604\nNumber of times present: 4\n\n\nFound at: 82888490886\nNumber of times present: 3\n\n\nFound at: 115836535414\nNumber of times present: 19\n\n\nFound at: 79615924948\nNumber of times present: 81\n') expected = {'A361': 175, '32B57': 107} assert answer == expected, f'Wrong answer; got {answer} instead of {expected}' print('All tests passed') |
{'A361': 174, '32B57': 106}
All tests passed
Testing if the previous output contains the string All tests passed
: True
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's a Python function `process` that takes data in the format you provided and returns a dictionary where the keys are the queries (e.g., A361, 32B57) and the values are the total number of times each query is present:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | def process(data): result = {} lines = data.strip().split('\n') current_query = None for line in lines: if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) |
1 | {'A361': 174, '32B57': 106} |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | def process(data): result = {} lines = data.strip().split('\n') current_query = None for line in lines: if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | def process(data): result = {} lines = data.strip().split('\n') current_query = None for line in lines: if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) answer = process('QUERY A361\nFound at: 160392127418\nNumber of times present: 4\n\n\nFound at: 150158692866\nNumber of times present: 4\n\n\nFound at: 122340445248\nNumber of times present: 17\n\n\nFound at: 137248651778\nNumber of times present: 84\n\n\nFound at: 131891981708\nNumber of times present: 66\n\n\nQUERY 32B57\nFound at: 194561247604\nNumber of times present: 4\n\n\nFound at: 82888490886\nNumber of times present: 3\n\n\nFound at: 115836535414\nNumber of times present: 19\n\n\nFound at: 79615924948\nNumber of times present: 81\n') expected = {'A361': 175, '32B57': 107} assert answer == expected, f'Wrong answer; got {answer} instead of {expected}' print('All tests passed') |
{'A361': 174, '32B57': 106}
All tests passed
Testing if the previous output contains the string All tests passed
: True
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's the Python function `process` that takes the data as input and returns a dictionary with the queries as keys and the total count of their presence as values:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result |
1 2 3 4 | { 'A361': 174, '32B57': 106 } |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result if __name__ == '__main__': data = ''' QUERY A361 Number of times present: 74 QUERY 32B57 Number of times present: 29 QUERY A361 Number of times present: 100 QUERY 32B57 Number of times present: 77 ''' result = process(data) print(result) |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result if __name__ == '__main__': data = ''' QUERY A361 Number of times present: 74 QUERY 32B57 Number of times present: 29 QUERY A361 Number of times present: 100 QUERY 32B57 Number of times present: 77 ''' result = process(data) print(result) answer = process('QUERY A361\nFound at: 160392127418\nNumber of times present: 4\n\n\nFound at: 150158692866\nNumber of times present: 4\n\n\nFound at: 122340445248\nNumber of times present: 17\n\n\nFound at: 137248651778\nNumber of times present: 84\n\n\nFound at: 131891981708\nNumber of times present: 66\n\n\nQUERY 32B57\nFound at: 194561247604\nNumber of times present: 4\n\n\nFound at: 82888490886\nNumber of times present: 3\n\n\nFound at: 115836535414\nNumber of times present: 19\n\n\nFound at: 79615924948\nNumber of times present: 81\n') expected = {'A361': 175, '32B57': 107} assert answer == expected, f'Wrong answer; got {answer} instead of {expected}' print('All tests passed') |
{'A361': 100, '32B57': 77}
All tests passed
Testing if the previous output contains the string All tests passed
: True
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's some data QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 Write a python function called `process` that will take data like this as an argument and return a dict where the keys are the like A361/32B57 and the values are how often its present in total.
Here's a Python function that processes the given data and returns a dictionary with the counts:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) |
1 | {'A361': 174, '32B57': 106} |
I extracted the following code from that output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) |
Running the following program:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | def process(data): result = {} current_query = None for line in data.split('\n'): line = line.strip() if line.startswith('QUERY'): current_query = line.split(' ')[1] result[current_query] = 0 elif line.startswith('Number of times present:'): count = int(line.split(':')[1].strip()) result[current_query] += count return result data = ''' QUERY A361 Found at: 160392127418 Number of times present: 4 Found at: 150158692866 Number of times present: 3 Found at: 122340445248 Number of times present: 17 Found at: 137248651778 Number of times present: 84 Found at: 131891981708 Number of times present: 66 QUERY 32B57 Found at: 194561247604 Number of times present: 4 Found at: 82888490886 Number of times present: 3 Found at: 115836535414 Number of times present: 19 Found at: 79615924948 Number of times present: 80 ''' result = process(data) print(result) answer = process('QUERY A361\nFound at: 160392127418\nNumber of times present: 4\n\n\nFound at: 150158692866\nNumber of times present: 4\n\n\nFound at: 122340445248\nNumber of times present: 17\n\n\nFound at: 137248651778\nNumber of times present: 84\n\n\nFound at: 131891981708\nNumber of times present: 66\n\n\nQUERY 32B57\nFound at: 194561247604\nNumber of times present: 4\n\n\nFound at: 82888490886\nNumber of times present: 3\n\n\nFound at: 115836535414\nNumber of times present: 19\n\n\nFound at: 79615924948\nNumber of times present: 81\n') expected = {'A361': 175, '32B57': 107} assert answer == expected, f'Wrong answer; got {answer} instead of {expected}' print('All tests passed') |
{'A361': 174, '32B57': 106}
All tests passed
Testing if the previous output contains the string All tests passed
: True