[Tutor] Guess Your Number Game

2006-01-17 Thread Jon Moore
HiI hope someone can help me!I am currently learning Python using a book by Michael Dawson. In one of the exercises I have to right a program that will guess a number chosen by the user.It is partly working, however it does not seem to keep state of numbers that should have already been ruled out a

[Tutor] Indexing in a series for a newbie

2006-01-19 Thread Jon Moore
ord jumble game and need to link the randomly chosen word to a hint should the user need one.-- Best Regards Jon Moore ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Controling my loops and redundant code?!?

2006-01-25 Thread Jon Moore
Hi,I have written the program below as an exercise from a book I am working my way through.Objective from book:Write a character creator program for a role-playing-game. The player should be given a pool of 30 points to spend on four attributes: strength, health, wisdom and dexterity. The player sh

Re: [Tutor] Controling my loops and redundant code?!?

2006-01-25 Thread Jon Moore
Alan   Many thanks, that is really useful.   I will go through this a bit at a time over the next few days to ensure I understand what I am doing!   I think functions come in the next chapter!   Jon  On 25/01/06, Alan Gauld <[EMAIL PROTECTED]> wrote: Hi Jon,> 1. I am sure I have written far more co

[Tutor] Dictionaries

2006-01-25 Thread Jon Moore
Hi Is there anyway to print informtation from dictionaries better than this?:   >>> pairs = {"Jon Moore": "Tony Moore", "Simon Nightingale": "John Nightingale", "David Willett": "Bernard Willet", "J

Re: [Tutor] Dictionaries

2006-01-26 Thread Jon Moore
KentThanks! I have not come accross string formatting yet, but I can see how the for statement works.How would I modify this to just print either the values or keys?Jon On 26/01/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Jon Moore wrote:> Hi>> Is there anyway to print in

[Tutor] Adding items to dictionaries

2006-01-26 Thread Jon Moore
Hi,I have the following dictionary:pairs = {"Jon Moore": ["Tony Moore", "Stanley Moore"], "Simon Nightingale": ["John Nightingale", "Alan Nightingale"], "David Willett": ["Bernard Willet", "Rober

Re: [Tutor] Adding items to dictionaries

2006-01-26 Thread Jon Moore
KentThanks again. I have a question (see below).On 26/01/06, Kent Johnson <[EMAIL PROTECTED]> wrote: Jon Moore wrote:> Hi,>> I have the following dictionary:>> pairs = {"Jon Moore": ["Tony Moore", "Stanley Moore"], >  "

Re: [Tutor] Controling my loops and redundant code?!?

2006-01-27 Thread Jon Moore
etty interesting exercise.PaulOn Thursday 26 January 2006 12:52 pm, Bob Gailer wrote:> At 08:44 AM 1/25/2006, Jon Moore wrote:>> Hi,> > I have written the program below as an exercise from a book I am working my> way through.>> Objective from book:> Write a character c

[Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
;step values' in anyway that I can see in the proceeding chapters!HELP!-- Best Regards Jon Moore ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
I guess I am not going mad then!I will skip this exercise and move on.ThanksJonOn 31/01/06, Alan Gauld < [EMAIL PROTECTED]> wrote:Hi Jon,> Improve the function ask_number() so that the function can be called with > a> step value. Make the default value of step 1.If its any consolation that doesn't

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
/01/06, Bob Gailer <[EMAIL PROTECTED]> wrote: Jon Moore wrote:> Hi,>> I am still working my way through my 'Python for absolute beginners> book' and have hit a brick wall with one of the end of chapter exercises.>> The challenge says: >> Improve the function

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
DannyMany thanks for that, I notice a few erratas that I am yet to come up against. This will save my sanity (well some of it)1JonOn 31/01/06, Danny Yoo <[EMAIL PROTECTED]> wrote: On Tue, 31 Jan 2006, Jon Moore wrote:> I have been looking for contact details for the author to ask him wha

Re: [Tutor] Newbie question re. Functions

2006-01-31 Thread Jon Moore
AlanAre you the author of Learn to Program Using Python: A Tutorial for Hobbyists, Self-starters and All Who Want to Learn the Art of Computer Programming? Is the book still available as a web site?JonOn 31/01/06, Alan Gauld <[EMAIL PROTECTED] > wrote:> So a general recommendation to authors is to

[Tutor] Todays Learning Python Question From a Newbie ;)

2006-02-01 Thread Jon Moore
e] = EMPTY     # since no one can win on next move, pick best open square    for move in BEST_MOVES:     if move in legal_moves(board):    print move         return move-- Best Regards Jon Moore ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Newbie question re. Functions

2006-02-01 Thread Jon Moore
ote: On 31/01/06, Jon Moore <[EMAIL PROTECTED]> wrote:> Improve the function ask_number() so that the function can be called with a> step value. Make the default value of step 1. >> The function looks like this:>> def ask_number(question, low, high):> """

Re: [Tutor] Todays Learning Python Question From a Newbie ;)

2006-02-02 Thread Jon Moore
On 02/02/06, Alan Gauld <[EMAIL PROTECTED]> wrote: Bob,>> Write a new computer_move() function for the tic-tac-toe game to plug>> the hole in the computers stratergy. See if you can create an opponent>> that is unbeatable!>> >> My main problem is that I can not see how the computers stratergy can>>

Re: [Tutor] Todays Learning Python Question From a Newbie ;)

2006-02-02 Thread Jon Moore
All that does is reverse the hole!?!?x:2o:4x:7o:0x:80:5    O |   | X    -      | O | O    -      | X | X On 02/02/06, Wolfram Kraus <[EMAIL PROTECTED]> wrote: Jon Moore wrote:[...]> Thanks to  André, there is a way to win every time if you take the first> move (se