There are two lists.
The first:
key = ['load.scenarios.attempts', 'load.scenarios.succeeds', 'load.scenarios.fails', 'load.scenarios.aborts', 'load.scenarios.attempts_ps', 'load.scenarios.succeeds_ps', 'load.scenarios.fails_ps', 'load.scenarios.aborts_ps'] Second:
val = ['Total', 'Per Second'] You need to create a dictionary of the following type:
{'load.scenarios.attempts' : 'Total', ..., 'load.scenarios.attempts_ps' : 'Per Second'} counters = {} for k, v in zip(key, val): counters[k] = v print(counters) But the cycle ends when the values of v end. But the main problem is to arrange it in the specified order.
What would "Total" refer only to 'load.scenarios.attempts' to such values.
And "Per Second" only where there is 'load.scenarios.attempts_ps' (_ps)