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
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
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.
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
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
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
"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
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
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
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
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
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
"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
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
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
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
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
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
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
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
>> 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
>> 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"
>>
>
"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
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
"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
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
>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
"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
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
29 matches
Mail list logo