3
Hello someone can help me recover values from that dictionary list?
sellers = [
{"name": "Joaquina", "store": 2, "value": 1200.00},
{"name": "Pedro", "store": 2, "value": 120.00},
{"name": "Maria", "store": 1, "value": 450.00},
{"name": "Fernanda", "store": 1, "value": 4000.00},
{"name": "Patricia", "store": 1, "value": 100.00},
]
When I do this operation on Pythontutor
def sales_goals(self, sellers):
abaixo_da_meta = sorted([vendedor["value"] for vendedor in sellers if vendedor["value"] < 500])
vendedores_falta_meta = [vendedor["name"] for vendedor in sellers if vendedor["value"] == abaixo_da_meta]
return vendedores_falta_meta
The seller variable_falta_meta does not retrieve the names of the variable lower_da_meta but an empty list, thanks!
Why did you use the
sorted
? Need the rated values?– Woss
Yes I need it in ascending order in this case and there is another case very similar but I need of unbelievable order
– Margot Paon Garcia