[Tutor] [Tutor]: Totally laughable basic questions

kirk Bailey idiot1@netzero.net
Tue, 15 Jan 2002 13:57:38 -0500


No, this is the place for these and even more basic questions.
WELCOME!

> "McCarney, James Alexander" wrote:
> 
> I am a programming neophyte.
GOGO GAGA ME TO.
> 
> Yes in my day-to-day life I use tools (usually text editing,
> manipulation, etc.), and these tools often involve 'programming' of
> a sort; but now I want to 'look under the hood.'
Ah, hacking lives.
> 
> I have heard of, and seen, the wonders of XML; and I am even aware [
> gasp! ;-) ] of basic OOP programming principles;
> but I am often perplexed about how to tie everything together.
> 
Extended Markup Language. An extension of HTML.

Personally, I like to use html with a light seasoning of CSS, a few
select javascript notions, and a tasteful sprinkling of Server Side
Includes. My preferred stile is lean and clean if the task permits it,
and minimize the crud whenever posible. As a result, my preferred
pages load FAST, whereas many 'professional' sites take up to A MINUTE
(shudder) on a 56k modem.

> Of course, I want to do it with Python, because I love Eric Idle,
> John Cleese, and the gang: Self-defense against a banana, wow!
> Now my hero is Mr. Bean, but I digress.  ;-)
>
Ah, exellent taste.
 
> What is more embarrassing (for me at least) is knowing when (AND
> WHY!) to use a dictionary, a tuple, a string object, etc.
> And when (AND WHY!) to slice, dice, concatenate, or otherwise fr*g
> with the contents of these groups.
>
> Maybe Python-Tutor is not the place for these type of questions, and
> if so, I apologise. If some kind soul out in Pythonland is aware of
> completely pre-basic tutors that can help me out with various
> elementary programming concepts I would be most grateful.
>
No, this is the place.

A LIST is rather like a 1 dimensional array. You can change the
contents of a list, even append new cells.

A DICTIONARY is rather like 2 lists in one, where there is a KEY and a
CONTENT.

Plug in the key, put pops the content associated with the key.

In an array, you would use an index number. for instance:
FOO(0)=huh?, FOO(1)=no, foo(2)=yes, foo=[huh?,no,yes]

in a dictionary, I could do this as:
foo[ERROR:huh?,notfound:no,found:yes]
earning me
>>>
foo['notfound']
no
>>>
This is VERY useful when the data is associated with a word, and us
REALLY handy for databases with fieldnames, and tends to sneak into
the cgi form circus all over the place. It caqme in REAL handy in
writing some email software recently that had to pay attention to the
content of the headers in a incoming letter. Headers may not always be
in the same sequence, but when you use a dictionary, we don't care.
Plug in 'From:' and get back the email address, for instance.

Gang, I hesitate to teach anyone anything about Python, I'm only 6
weeks removed from drooling on my python rattle myself. Pardon any
inaccuacies or errors.
> Cheers.
> 
> James Alexander McCarney, Technical Writer
> M3i Systems Inc., 1111 Saint-Charles Avenue West
> 11th Floor, East Tower, Longueuil, Quebec, J4K 5G4
> Canada
> 
> Telephone: (450) 928-3386 x2262
> Fax: (450) 442-5076
> 
> http://www.m3isystems.com
> 
> 

-- 
 

 -Respectfully,
              -Kirk D Bailey 
               Consulting Loose Cannon

end



  www.howlermonkey.net                 highprimate@howlermonkey.net
  www.sacredelectron.org                         idiot1@netzero.net
  www.tinylist.org                              grumpy@tinylist.org
----------------------------------------------------
Sign Up for NetZero Platinum Today
Only $9.95 per month!
http://my.netzero.net/s/signup?r=platinum&refcd=PT97