You forgot a closing parenthesis in the line before.

y.append( probability( prob, n, N )

should be

y.append( probability( prob, n, N ))

This is a rather classical issue with syntax checking.

The parser doesn't know whether you forgot the closing parenthesis or whether you wanted to write a multi-line statement.

y.append( probability( prob, n, N )

should be

y.append( probability( prob, n, N ))

This is a rather classical issue with syntax checking.

The parser doesn't know whether you forgot the closing parenthesis or whether you wanted to write a multi-line statement.