I have a dictionary comprising of keys and values as integers in a lists, e.g.,
input: {
'example_key1': [358, 57, 18602, 18388],
'example_key2': [415, 12, 4800, 2013],
'example_key3': [450, 10, 4500, 4500],
}
I wish to divide the last value with the second to last value in the list for every key, multiply the answer by 100 and enter the answer into a similar dictionary with with ndigit = 1 point round.
output: {
'example_key1': [98.8], # [round((((18388 / 18602)) * 100), 1)]
'example_key2': [41.9], # [round((((2103 / 4800)) * 100), 1)]
'example_key3': [100.0], # [round((((4500 / 4500)) * 100), 1)]
}