For the calculate field to multiply all the fields together, try this. I'm assuming you're using ArcGIS Pro. This won't work in ArcMap.
# Use the Field Calculator to calculate the product
poa_fields_expr = ",".join([f"!{f.name}!" for f in poa_fields])
expr = f"my_calc_func({poa_fields_expr})"
# *args allows any number of arguments to be passed into the function.
code = '''def my_calc_func(*args):
result = 1
for poa_value in args:
result = result * poa_value
return 1 - result
'''
arcpy.management.CalculateField(
in_table=layer,
field="Product_poa",
expression=expr,
expression_type="PYTHON3",
code_block=code
)
As for the other part of your code sample wehre you are setting the first field to 1, I recommend using calculate field because it will be consistent with using calculate field for multiplying the fields and you can explicitly name the field you're calculating rather than implicitly expecting the first field to be the one you want to calc.
# Set the default value for "the field name here"
arcpy.management.CalculateField(
in_table=layer,
field="the field name here",
expression="1"
)
Which brings me to a final point: I see you are setting that field to a string "1" instead of an integer 1. If your other poa fields are strings, you will need to convert them to a number in your code. Here is a final code (untested) that also forces the field values to be a number.
import arcpy
# Get the selected layer
layer = arcpy.GetParameterAsText(0)
# Set the default value for "the field name here"
arcpy.management.CalculateField(
in_table=layer,
field="the field name here",
expression="1"
)
# Format the list of fields for calculate field.
poa_fields_expr = [f"!{f.name}!" for f in arcpy.ListFields(layer, wild_card="poa*")]
# Build expression and code block to calculate the Product_poa field.
expr = f"my_calc_func({poa_fields_expr})"
# *args allows any number of arguments to be passed into the function.
code = '''def my_calc_func(*args):
result = 1
for poa_value in args:
result = result * float(poa_value)
return 1 - result
'''
arcpy.management.CalculateField(
in_table=layer,
field="Product_poa",
expression=expr,
expression_type="PYTHON3",
code_block=code
)