To loop through the units, decrease them by 1, update rent and calculate profit each time. follow >
for u in range(50, 0, -1) rent += 30 profit = (u * rent) - (u * 37) print(f"Units: {u}, Rent: {rent}, Profit: {profit}")