Re: [Tutor] role playing game - help needed

2010-12-12 Thread David Hutto
On Sun, Dec 12, 2010 at 2:45 PM, David Hutto wrote: > On Sun, Dec 12, 2010 at 2:45 PM, David Hutto wrote: >> On Sun, Dec 12, 2010 at 2:44 PM, Walter Prins wrote: >>> >>> >>> On 12 December 2010 19:16, David Hutto wrote:  I recall you making a habit of being an asshole(pystats sho

Re: [Tutor] role playing game - help needed

2010-12-12 Thread David Hutto
On Sun, Dec 12, 2010 at 2:45 PM, David Hutto wrote: > On Sun, Dec 12, 2010 at 2:44 PM, Walter Prins wrote: >> >> >> On 12 December 2010 19:16, David Hutto wrote: >>> >>>  I recall you making a habit of being an >>> asshole(pystats should ring a bell, thanks for giving me the credit >>> for inspi

Re: [Tutor] role playing game - help needed

2010-12-12 Thread David Hutto
On Sun, Dec 12, 2010 at 2:44 PM, Walter Prins wrote: > > > On 12 December 2010 19:16, David Hutto wrote: >> >>  I recall you making a habit of being an >> asshole(pystats should ring a bell, thanks for giving me the credit >> for inspiration...bitch) > > Rudeness objection.  Ad-hominem objection.

Re: [Tutor] role playing game - help needed

2010-12-12 Thread Walter Prins
On 12 December 2010 19:16, David Hutto wrote: > I recall you making a habit of being an > asshole(pystats should ring a bell, thanks for giving me the credit > for inspiration...bitch) > Rudeness objection. Ad-hominem objection. Come on, this is not kindergarten. We all have our foibles, and

Re: [Tutor] role playing game - help needed

2010-12-12 Thread David Hutto
On Sun, Dec 12, 2010 at 2:16 PM, David Hutto wrote: > On Sat, Dec 11, 2010 at 10:39 PM, Steven D'Aprano wrote: >> David Hutto wrote: >>> >>> On Sat, Dec 11, 2010 at 11:54 AM, Lie Ryan wrote: On 12/07/10 23:37, Robert Sjöblom wrote: > > I've been told to use input() if I know th

Re: [Tutor] role playing game - help needed

2010-12-12 Thread David Hutto
On Sat, Dec 11, 2010 at 10:39 PM, Steven D'Aprano wrote: > David Hutto wrote: >> >> On Sat, Dec 11, 2010 at 11:54 AM, Lie Ryan wrote: >>> >>> On 12/07/10 23:37, Robert Sjöblom wrote: I've been told to use input() if I know that I'll only get integers, and raw_input() for "everythin

Re: [Tutor] role playing game - help needed

2010-12-12 Thread Alan Gauld
"David Hutto" wrote > That is a bad piece of advice. You should only use input() when > you can > fully trust whoever doing the input (i.e. you). Who uses the crap we, as noobies produce? Hopefully you do. And can you really be absolutely sure you won't accidentally type a dangerous command

Re: [Tutor] role playing game - help needed

2010-12-11 Thread Steven D'Aprano
David Hutto wrote: On Sat, Dec 11, 2010 at 11:54 AM, Lie Ryan wrote: On 12/07/10 23:37, Robert Sjöblom wrote: I've been told to use input() if I know that I'll only get integers, and raw_input() for "everything." That is a bad piece of advice. You should only use input() when you can fully tr

Re: [Tutor] role playing game - help needed

2010-12-11 Thread David Hutto
On Sat, Dec 11, 2010 at 11:54 AM, Lie Ryan wrote: > On 12/07/10 23:37, Robert Sjöblom wrote: >> I've been told to use input() if I know that I'll only get integers, >> and raw_input() for "everything." > > That is a bad piece of advice. You should only use input() when you can > fully trust whoeve

Re: [Tutor] role playing game - help needed

2010-12-11 Thread Lie Ryan
On 12/07/10 23:37, Robert Sjöblom wrote: > I've been told to use input() if I know that I'll only get integers, > and raw_input() for "everything." That is a bad piece of advice. You should only use input() when you can fully trust whoever doing the input (i.e. you). input() can accept any python

Re: [Tutor] role playing game - help needed

2010-12-10 Thread ALAN GAULD
Thanks again Alan. Much clearer now. One final part I don't understand. > "%d is the result of %d + %d" % (6+7,6,7) > >I understand (I think) the 6+7 part but why the ,6,7 after that. I could >see how either '6+7' or '6,7' would be the correct format but not both. The format string ha

Re: [Tutor] role playing game - help needed

2010-12-09 Thread ALAN GAULD
Can you explain this in a little more detail? > > sure. > >for name in attributes.keys(): > attributes[name] = int( input("How many points do you want to assign to %s " > % >name) ) > >Where did you get 'name' from? > I made it up. The for loop takes the form for in : where the

Re: [Tutor] role playing game - help needed

2010-12-08 Thread Alan Gauld
"Al Stern" wrote Anyway, I finally finished the program. I am sure it isn't the most efficient code and I suspect I should have used the 'while' loop earlier, Some things to think about below. attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = int(30) ke

Re: [Tutor] role playing game - help needed

2010-12-08 Thread Al Stern
Peter, Thanks for the advice as to how to use numbers. I had learned this before but the example in the documentation didn't use 'int' so I thought I didn't need to when using dictionary values. Anyway, I finally finished the program. I am sure it isn't the most efficient code and I suspect I sh

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Peter Otten
Al Stern wrote: > I used the following code and got the following error. The result of input is always a string. > attributes["strength"] = input("\nHow many points do you want to assign to > strength?: ") Say you type 42 when you run your script. Then the above assignment is effectively at

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Adam Bark
On 07/12/10 22:10, Al Stern wrote: Tried to use the documentation but still getting the errors... The 1st one has to do with the available_points # set variables attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = 30 available_points = MAX_POINTS - attributes.value

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Al Stern
Tried to use the documentation but still getting the errors... The 1st one has to do with the available_points # set variables attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = 30 available_points = MAX_POINTS - attributes.values() keys = attributes.keys() values

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Peter Otten
Al Stern wrote: > Apologies for all my questions. Up to this point I have been able to work > out most of the challenges but I seem to have hit a wall. Can't seem to > make any progress and completely frustrated. > > I looked at the 11/21 discussion. From the documentation, I realized I > need

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Al Stern
Apologies for all my questions. Up to this point I have been able to work out most of the challenges but I seem to have hit a wall. Can't seem to make any progress and completely frustrated. I looked at the 11/21 discussion. From the documentation, I realized I needed to set the variables to vi

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Peter Otten
Robert Sjöblom wrote: >> Close, but remember that input() returns a string. You need numbers >> so you need to convert strings to integers. > > Actually, input() only accept integers, consider the following: input("input: ") > input: d > > Traceback (most recent call last): > File "", line

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Robert Sjöblom
>> attributes["strength"] = input("\nHow many points do you want to >> assign to >> strength?: ") >> >> Please let me know if this isn't advisable.  It seems to work on the >> surface. > > Close, but remember that input() returns a string. You need numbers > so you need to convert strings to intege

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Robert Sjöblom
>> Thanks for the advice. I think I have the dictionary function set up right >>> now although I'm still not clear why it is better than the list. >>> >>> attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} >>> >> >> Consider where you want to update the points for "health" >> >

Re: [Tutor] role playing game - help needed

2010-12-07 Thread Alan Gauld
"Al Stern" wrote attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = 30 How do I set the variable for available_points? available_points = MAX_POINTS - (not sure what goes here) Check the mail from Robert Sjoblom, he gives you the necessary clues. You can c

Re: [Tutor] role playing game - help needed

2010-12-06 Thread Al Stern
Ok. I think I am starting to get it but still not sure how to separate the value from the key. Once I have this... attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} MAX_POINTS = 30 How do I set the variable for available_points? available_points = MAX_POINTS - (not sure wh

Re: [Tutor] role playing game - help needed

2010-12-06 Thread Alan Gauld
"Al Stern" wrote Thanks for the advice. I think I have the dictionary function set up right now although I'm still not clear why it is better than the list. attributes = {"strength": 0, "health": 0, "wisdom": 0, "dexterity": 0} Consider where you want to update the points for "health" U

Re: [Tutor] role playing game - help needed

2010-12-06 Thread Al Stern
4 AM To: tutor@python.org Subject: Re: [Tutor] role playing game - help needed >I am starting with a book called Python Programming for the Absolute Beginner by Michael Dawson.  The book has been >pretty good >and up to this point, I have grasped all the concepts it has covered.  At the end

Re: [Tutor] role playing game - help needed

2010-12-06 Thread Robert Sjöblom
>I am starting with a book called Python Programming for the Absolute Beginner >by Michael Dawson.  The book has been >pretty good >and up to this point, I >have grasped all the concepts it has covered.  At the end of each chapter, >there are a number of challenges you >need to complete before m

Re: [Tutor] role playing game - help needed

2010-12-06 Thread Alan Gauld
"Alan Stern" wrote Hi all. My name is Al Stern. Hi Al, Chapter 5: Lists and Dictionaries. Note Lists AND Dictionaries I'm not sure exactly how this mailing list works but was hoping someone here could give me some insight You are doing just fine. The only extra info we could fin

[Tutor] role playing game - help needed

2010-12-05 Thread Alan Stern
Hi all. My name is Al Stern. I am an absolute beginner to programming and based on what I'd read, decided to try Python as my 1st language. I am starting with a book called Python Programming for the Absolute Beginner by Michael Dawson. The book has been pretty good and up to this point, I h