Help me on function definition

Ben Finney bignose+hates-spam at
Sat Mar 29 03:16:07 CET 2008

"aeneng" <aeneng at> writes:

> I am just starting to use python in numerical cacluation. 

Welcome, and congratulations on learning Python.

> I need you to help me to see what's wrong with the following piece
> of codes [...]

Your code is rather difficult to read, since your expressions have all
the characters mashed together without spaces. It will help others who
read your code if you follow the Python coding guidelines in PEP 8

You should also choose names that are descriptive when someone reads
the code, and not single-character algebraic names.

> when I import the function, error message show like this
> >>> import cross
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "", line 8
>     ppp2=u[2]*v[0]-u[0]*v[2]
>     ^
> SyntaxError: invalid syntax

I suspect you will gain enlightenment in this case by running your
code via 'python -t' where '' is the Python module you're
trying to run. (You can see a description of that option with 'python
-h' to display the commandline help.)

 \        "I have one rule to live by: Don't make it worse."  -- Hazel |
  `\                                                          Woodcock |
_o__)                                                                  |
Ben Finney

More information about the Python-list mailing list