Need help with Python programming problem.

Steven Taschuk staschuk at telusplanet.net
Sat May 10 15:59:43 EDT 2003


Quoth gk:
  [...]
> You're right. But the thing is that i was thrown into python all of a 
> sudden without any programming background.  Now, i understand the 
> problem and the logic.  Its just that the syntax is killing me.

If it really is just the syntax, then the Python Tutorial should
get you on your way quite quickly:

    <http://www.python.org/doc/current/tut/tut.html>

But it's hard to believe that, with no programming background, the
only thing you're having trouble with is the syntax.  Here's a
(slightly edited) example from your OP:

    ##Store the deck as a list
    Deck = []

    ##Populate the deck with cards

This last is a fine high-level outline of what you want to do next
-- "populate the deck with cards".  But there's lots of nuts and
bolts missing.  Perhaps most saliently: what's a card?  A tuple of
its suit and rank?  An integer in [0..51], its suit and rank
inferred?  An instance of some class, with .isfacecard() and like
methods?  This is not a question of syntax; it is a question of
implementation.

You do seem to "understand the logic" at a high level; but writing
a program requires that you understand it all the way down to the
nuts and bolts level too.

If you don't know how to answer the question "what's a card?" in
the context of your program, then I'd again suggest the Python
Tutorial.  Also, as others have suggested, the tutor mailing list
might be of more assistance to you than we can be.

-- 
Steven Taschuk             "The world will end if you get this wrong."
staschuk at telusplanet.net     -- "Typesetting Mathematics -- User's Guide",
                                 Brian Kernighan and Lorrinda Cherry





More information about the Python-list mailing list