I'm like to iterate over a list of received data from Digikey api any didn't have much luck googling since the function enumerate(reversed(part.standard_pricing)) just doesn't work and you can't reverse the part.standard_pricing for some reason
Something like that is desired:
for b_idx in range(part.standard_pricing, -1, -1):
print(f"Test at: {b_idx} , Q: {part.standard_pricing[b_idx].break_quantity}")
if PCountQ >= part.standard_pricing[b_idx].break_quantity:
parts_df['PRICE_PER_PCB_Q'][idx] = part.standard_pricing[b_idx].unit_price * PCountQ
break
But range doesn't work on list either...
I'd like to do that:
for b_idx, price_break in enumerate(part.standard_pricing):
just instead start from the end of part.standard_pricing and have the index decrease instead of increase
Any idea on how to do that pythonically?