May-30-2020, 10:00 AM
(May-30-2020, 09:55 AM)WiPi Wrote: Here's another straightforward method
dictOfVals = {1: 0.2, 2: -0.1, 3: 2, 4: 0.1, 5: 0.05} newDict=dict() # Iterate over all the dict values for value in dictOfVals.values(): if value > 0.1 or value < -0.1: print(value)
How would I also get the corresponding key for each value?