1👍
✅
variants
is presumably a list. In python you use square brackets to index a list:
if product.variants[0].inventory_management:
Source:stackexchange.com