For error purposes, count from the first line of the script that you are trying to run, or a snippet if for example you've copied only part of it into the console.
As BERA commented, the arcpy function is arcpy.CalculateField_management, not calcField (although I'd expect you'd get a different error, such as NameError: name 'calfField' is not defined
)
It's possible it's not parsing the codeblock properly due to lack of visible indentation but again I'd expect a different error. Just in case though, follow the example here: https://pro.arcgis.com/en/pro-app/tool-reference/data-management/calculate-field.htm
EDIT: function definitions need to start with def -- add that in your code block (credit for catching this error: BERA).