Re: [Tutor] Adding to a dict through a for loop confusion.

2016-05-17 Thread Chris Kavanagh
, May 17, 2016 at 5:01 AM, wrote: > On 17May2016 04:28, Chris Kavanagh wrote: > >> Could someone tell me why this different behavior occurs between these 2 >> code snippets, please. The 1st example has quotes around it ['item'] only >> adds the last item to the dict (car

[Tutor] Adding to a dict through a for loop confusion.

2016-05-17 Thread Chris Kavanagh
Could someone tell me why this different behavior occurs between these 2 code snippets, please. The 1st example has quotes around it ['item'] only adds the last item to the dict (cart). In the 2nd example the item does not have quotes around it [item] and every entry is added to the dict. Why? #

Re: [Tutor] Staticmethod & Classmethod Question

2012-02-25 Thread Chris Kavanagh
On 2/25/2012 4:34 AM, Dave Angel wrote: On 02/25/2012 03:31 AM, Chris Kavanagh wrote: Hey Everyone, I came across this code in 'A Byte Of Python' & realized there was a line I didn't understand. The line is "howMany = staticmethod(howMany)" (Complete code pasted

[Tutor] Staticmethod & Classmethod Question

2012-02-25 Thread Chris Kavanagh
Hey Everyone, I came across this code in 'A Byte Of Python' & realized there was a line I didn't understand. The line is "howMany = staticmethod(howMany)" (Complete code pasted below.) I don't think, in my very short Python career, I've heard of a staticmethod or classmethod. There's very

[Tutor] To: Wayne Werner , re Reg. Expressions Parenthesis

2012-01-18 Thread Chris Kavanagh
For some reason I didn't get this email, found it in the archives. I wanted to make sure I thanked Wayne for the help!!! On Tue, Jan 17, 2012 at 3:07 AM, Chris Kavanagh <[hidden email]> wrote: Hey guys, girls, hope everyone is doing well. Here's my question, when using Reg

[Tutor] Reg Ex Parentheses

2012-01-17 Thread Chris Kavanagh
ing group, so you can call m.group(1) to get the text matched by that part of the regex. > matches a literal greater-than sign Thanks, Chris Kavanagh ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] Reg. Expressions Parenthesis

2012-01-17 Thread Chris Kavanagh
ing group, so you can call m.group(1) to get the text matched by that part of the regex. > matches a literal greater-than sign Thanks, Chris Kavanagh ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Simple Question (I Hope)

2012-01-15 Thread Chris Kavanagh
On 1/14/2012 11:17 PM, Modulok wrote: On 1/14/12, Chris Kavanagh wrote: I was looking at this code from the Python Docs (http://docs.python.org/library/email-examples.html), trying to learn how to send email from a Pyhton script. Anyways, part of this code confused me. Here's the scrip

[Tutor] Simple Question (I Hope)

2012-01-14 Thread Chris Kavanagh
I was looking at this code from the Python Docs (http://docs.python.org/library/email-examples.html), trying to learn how to send email from a Pyhton script. Anyways, part of this code confused me. Here's the script: 1 # Import smtplib for the actual sending function 2 import smtplib 3 4 # Imp

[Tutor] Variables (with lists??)

2011-11-22 Thread Chris Kavanagh
I was going over one of Derek Banas' tutorials on youtube, and came across something I hadn't seen before. A variable with a list beside it (see code below). He sets the variable, customer , equal to a dict. Then uses the variable with ['firstname'],['lastname'], ect. I've never seen this in my

Re: [Tutor] Help

2011-10-31 Thread Chris Kavanagh
they were executed from the top down. Obviously I was getting somewhat confused because of this. This 'dragon' program makes much more sense to me now that I understand that. . .Thanks again Steven & everyone!!! Happy Halloween!!! On 10/31/2011 11:07 PM, Chris Kavanagh wrote: Ye

Re: [Tutor] Help

2011-10-31 Thread Chris Kavanagh
#x27;t global variables have to be declared at the 'top' of the code?? On 10/31/2011 9:55 PM, Steven D'Aprano wrote: Chris Kavanagh wrote: However, I'm confused on Line 30 {if chosenCave== str(friendlyCave)}. Here's the description of this line the author gives: "H

[Tutor] Help

2011-10-31 Thread Chris Kavanagh
This code is from the book 'Invent your own computer games with Python' 2nd edition. Great book so far. . . My question comes on the 2nd game (dragon game). Just a simple little program that lets you choose to enter 'cave one' or 'cave two' by using the random module, radnom.randint. If you ch

Re: [Tutor] Simple Question On A Method (in subclass)

2011-10-25 Thread Chris Kavanagh
On 10/25/2011 3:50 AM, Dave Angel wrote: On 10/25/2011 12:20 AM, Chris Kavanagh wrote: On 10/24/2011 12:06 AM, Marc Tompkins wrote: On Sun, Oct 23, 2011 at 8:08 PM, Chris Kavanagh My problem was, I wasn't seeing {member} as referring to the class objects {t} and {s}. Since it wa

Re: [Tutor] Simple Question On A Method (in subclass)

2011-10-24 Thread Chris Kavanagh
On 10/24/2011 12:06 AM, Marc Tompkins wrote: On Sun, Oct 23, 2011 at 8:08 PM, Chris Kavanagh mailto:cka...@msn.com>> wrote: So we have {member.tell} as the last line of code. So trying to understand this piece of code, {member} the variable is considered an object? Theref

Re: [Tutor] Simple Question On A Method (in subclass)

2011-10-24 Thread Chris Kavanagh
On 10/24/2011 4:40 AM, Alan Gauld wrote: On 24/10/11 04:08, Chris Kavanagh wrote: Thanks so much for the help Alan. . .I'm not trying to beat this question into the ground, LOL, but let me see if I can ask it a better way. Marc has already given a good answer, but I'll try

Re: [Tutor] Simple Question On A Method (in subclass)

2011-10-23 Thread Chris Kavanagh
On 10/23/2011 8:28 PM, Alan Gauld wrote: On 24/10/11 00:54, Chris Kavanagh wrote: Speaking of the last line of code, I have a question about that also. The last line should have been (without my error) {member.tell()}. My question is, why couldn't this last line have been {print m

Re: [Tutor] Simple Question On A Method (in subclass)

2011-10-23 Thread Chris Kavanagh
imple Question On A Method (in subclass) Date: Sun, 23 Oct 2011 16:53:40 -0400 From: Chris Kavanagh Organization: Home Office To: d...@davea.name On 10/22/2011 6:59 PM, Dave Angel wrote: My question is regarding the tell methods in the subclasses,the code {SchoolMember.tell(self)}, in the class Te

[Tutor] Simple Question On A Method (in subclass)

2011-10-22 Thread Chris Kavanagh
Hello, First, thank you for providing this GREAT service, & THANKS to everyone who contributes. It's greatly appreciated. . .I'm new to Python (2.7, Win XP) & new to programming in general. I have been studying on my own for about a month now. I believe I have a good grasp of the basics. Secon