On 05/08/2012 22:32, Roy Smith wrote:
In article <mailman.2972.1344200565.4697.python-l...@python.org>,
Tim Chase <python.l...@tim.thechases.com> wrote:
On 08/05/12 15:52, John Mordecai Dildy wrote:
Current Problem at the moment
Traceback (most recent call last):
File "ex26.py", line 66, in <module>
beans, jars, crates = secret_formula(start-point)
NameError: name 'start' is not defined
anyone know how to make start defined
"start-point" is not a valid identifier as the "-" isn't permitted
in a variable name. This is the case for just about every language
out there. HTML/XML & CSS are the only languages that come to my
mind in which the dash is considered a valid part of an identifier.
You either mean something like "start_point" (with an underscore
instead of a minus), or you're performing a subtraction of "start
minus point", in which case you'd have to assign those values before
you use them.
Or he meant to pass an optional parameter:
beans, jars, crates = secret_formula(start=point)
or an element access:
beans, jars, crates = secret_formula(start.point)
or a bunch of other possibilities.
Like it, marks out of 10, 15 :)
--
Cheers.
Mark Lawrence.
--
http://mail.python.org/mailman/listinfo/python-list