I am trying to remove keys from a dictionary:
incomes = {'apple': 5600.00, 'orange': 3500.00, 'banana': 5000.00}
non_citric = {k: incomes[k] for k in incomes.keys() - {'orange'} }
non_citric
output:
{'banana': 5000.0, 'apple': 5600.0}
I am however confused as to why the original order of the keys is not preserved