Marc Tompkins wrote:
It can be a little hard to wrap your head around how Python handles
variables/objects; in other languages you create a variable and assign a
value to it, while in Python you create an object and assign a name to it -
the name can change while the object remains unchanged. He
Tutor] Simple Question On A Method (in subclass)
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
On Tue, Oct 25, 2011 at 5:31 AM, Chris Kavanagh wrote:
>
>
> 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 proble
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 was, we now
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 was, we now can use member just like any
class object
On Mon, Oct 24, 2011 at 3:44 PM, bob gailer wrote:
> On 10/24/2011 7:45 AM, Wayne Werner wrote:
>
> On Sun, Oct 23, 2011 at 11:06 PM, Marc Tompkins
> wrote:
>
>> Things to remember:
>> -you can get a value from a method, but you can't assign to it:
>> variable = object.method()
>> but NOT
On Mon, Oct 24, 2011 at 9:20 PM, Chris Kavanagh wrote:
> Makes perfect sense now. . .Thanks again Marc (and Alan, Dave)
> BTW, do you guys luv Python the way I do!?? I just luv the way everything
> works together so explicitly. I LUV learning this stuff!!
>
Oh yeah, baby. Python makes programmi
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? Therefore we can
On 10/24/2011 7:45 AM, Wayne Werner wrote:
On Sun, Oct 23, 2011 at 11:06 PM, Marc Tompkins
mailto:marc.tompk...@gmail.com>> wrote:
Things to remember:
-you can get a value from a method, but you can't assign to it:
variable = object.method()
but NOT
object.method() =
On 24/10/11 11:17, lina wrote:
a quick Q: Every time call the method, need go through the __initi__( ) part?
No.
__init__() is only called when an instance is first created.
Here is an example in the IDLE:
>>> class C:
def __init__(self):
print("I'm in init")
On Sun, Oct 23, 2011 at 11:06 PM, Marc Tompkins wrote:
> Things to remember:
> -you can get a value from a method, but you can't assign to it:
> variable = object.method()
> but NOT
> object.method() = variable
>
As a slight aside, you _can_ assign to the method name:
object.method = var
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 a slightly differ
a quick Q: Every time call the method, need go through the __initi__( ) part?
Thanks, I attached the one I used to practice fast-typing:
#!/usr/bin/python3
class SchoolMember:
'''Represents any school members.'''
def __init__(self,name,age):
self.name = name
self.age
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 a slightly different
approach to the same thing The diff
On Sun, Oct 23, 2011 at 8:08 PM, Chris Kavanagh 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? Therefore
> we can combine it with a function {tell()} using dot notation?? Is this
> correct???
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 member}??
I
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 member}??
It could have been, but the output would have
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
(please do REPLY-ALL, or at least add the mailing list to the recipient
list. Otherwise, only one person will see the message. I'm forwarding
it to the group with my comments added.)
Original Message
Subject: Re: [Tutor] Simple Question On A Method (in subclass)
Date
On 22/10/11 23:10, Chris Kavanagh wrote:
My question is regarding the tell methods in the subclasses,the code
{SchoolMember.tell(self)}, in the class Teacher & Student. I just don't
understand what this is doing? Calling the first method {def tell} from
the parent class, I assume?
Thats right,
On 10/22/2011 06:10 PM, Chris Kavanagh wrote:
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 bel
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
22 matches
Mail list logo