[Tutor] Reg Ex Parentheses

2012-01-17 Thread Chris Kavanagh
Hey guys, girls, hope everyone is doing well. Here's my question, when using Regular Expressions, the docs say when using parenthesis, it "captures" the data. This has got me confused (doesn't take much), can someone explain this to me, please?? Here's an example to use. It's kinda long, so,

Re: [Tutor] Class vs. instance

2012-01-17 Thread Dave Angel
On 01/17/2012 09:13 PM, Stayvoid wrote: Hello! Here is another one. class A: def __init__(self, data): self.data = data print self.data I'm trying to understand this function-like syntax: A('foo').__init__(42) A(12).data What are we actually calling thi

Re: [Tutor] Class vs. instance

2012-01-17 Thread Stayvoid
Hello! Here is another one. class A: def __init__(self, data): self.data = data print self.data I'm trying to understand this function-like syntax: A('foo').__init__(42) A(12).data What are we actually calling this way? Are there any other ways to get the

Re: [Tutor] Virtual pet cat program

2012-01-17 Thread Prasad, Ramit
>As you can see, no matter how many times I 'feed' the cat, its always hungry. >Can someone please tell me why it wont update? >while choice != "0": >print("What would you like to do? (Enter 1 to feed the cat, enter 2 to > play with the cat, enter 3 to leave the cat to rest or press 0 to

[Tutor] Virtual pet cat program

2012-01-17 Thread myles broomes
I am trying to code a virtual pet cat program. Heres what I have come up with so far: #Pet cat program #the user chooses a cat of their choice; choosing attributes such as colour, name etc #the user then has to look after the cat and keep it alive #create a class for the cat class Cat(object)

Re: [Tutor] Reg. Expressions Parenthesis

2012-01-17 Thread Wayne Werner
On Tue, Jan 17, 2012 at 3:07 AM, Chris Kavanagh wrote: > Hey guys, girls, hope everyone is doing well. > > Here's my question, when using Regular Expressions, the docs say when > using parenthesis, it "captures" the data. This has got me confused > (doesn't take much), can someone explain this to

[Tutor] Reg. Expressions Parenthesis

2012-01-17 Thread Chris Kavanagh
Hey guys, girls, hope everyone is doing well. Here's my question, when using Regular Expressions, the docs say when using parenthesis, it "captures" the data. This has got me confused (doesn't take much), can someone explain this to me, please?? Here's an example to use. It's kinda long, so,