Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Intermediate Python user needed help

Reply
Thread Tools

Intermediate Python user needed help

 
 
John Mordecai Dildy
Guest
Posts: n/a
 
      08-05-2012
Im using Textwrangler and thats the only text editor that im using just saying for everyone
 
Reply With Quote
 
 
 
 
Andre Ramaciotti
Guest
Posts: n/a
 
      08-05-2012
On 08/05/2012 06:12 PM, MRAB wrote:
> On 05/08/2012 22:03, Tim Chase 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.
>>

> I believe that Cobol allows "-" in names.
>

Lisp certainly does.
 
Reply With Quote
 
 
 
 
Roy Smith
Guest
Posts: n/a
 
      08-05-2012
In article <mailman.2972.1344200565.4697.python->,
Tim Chase <> 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.
 
Reply With Quote
 
John Mordecai Dildy
Guest
Posts: n/a
 
      08-05-2012
since when did we start talking about lisp?
 
Reply With Quote
 
John Mordecai Dildy
Guest
Posts: n/a
 
      08-05-2012
since when did we start talking about lisp?
 
Reply With Quote
 
Mark Lawrence
Guest
Posts: n/a
 
      08-05-2012
On 05/08/2012 22:32, Roy Smith wrote:
> In article <mailman.2972.1344200565.4697.python->,
> Tim Chase <> 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.

 
Reply With Quote
 
Mark Lawrence
Guest
Posts: n/a
 
      08-05-2012
On 05/08/2012 23:00, John Mordecai Dildy wrote:
> since when did we start talking about lisp?
>


Just about anything is on topic here.

--
Cheers.

Mark Lawrence.

 
Reply With Quote
 
John Mordecai Dildy
Guest
Posts: n/a
 
      08-05-2012
oh
 
Reply With Quote
 
Tim Chase
Guest
Posts: n/a
 
      08-05-2012
On 08/05/12 17:00, John Mordecai Dildy wrote:
> since when did we start talking about lisp?


Though not a lisper, the Python tie-in was my reply: Python (among
many other languages) doesn't allow a "-" as a character in
identifiers as you appeared to use it in your code. Unlike HTML,
XML, CSS, and apparently lisp and COBOL (thanks, MRAB, for ripping
open that scab after years of trying to repress those COBOL memories
where identifiers may contain the dash.

-tkc


 
Reply With Quote
 
Tim Chase
Guest
Posts: n/a
 
      08-05-2012
On 08/05/12 16:32, Roy Smith wrote:
> Tim Chase <> wrote:
>> 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 pass a boolean

beans, jars, crates = secret_formula(start>point)

Or subscript with an also-missing close-bracket

beans, jars, crates = secret_formula(start[point])

Or call a function with an also-missing close-paren

beans, jars, crates = secret_formula(start(point))

Or it was just a finger-flub

beans, jars, crates = secret_formula(startpoint)



-tkc


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
intermediate python csv reader/writer question from a beginner Learning Python Python 1 02-24-2009 12:32 AM
Help Help, I am intermediate in Java...need help in follow case ElementX Java 9 10-01-2008 08:02 PM
LWP user agent grabs the intermediate wait page after POST intead ofthe actual result page bhabs Perl Misc 2 02-13-2008 01:55 AM
NEEDED IMMEDIATELY!!! Intermediate Technical Support Specialist Jennifer Nasnas Computer Support 9 06-25-2004 11:09 PM



Advertisments