Re: Fwd: class print method...

2011-12-05 Thread Suresh Sharma
-- Forwarded message -- >> From: Suresh Sharma >> Date: Monday, December 5, 2011 >> Subject: class print method... >> To: "d...@davea.name <mailto:d...@davea.name>" > <mailto:d...@davea.name>> >> >> >> Dave, >> Thanx f

Re: Fwd: class print method...

2011-12-05 Thread Terry Reedy
On 12/5/2011 8:09 AM, Dave Angel wrote: useful, such as if you print a list. The __str__() method of list calls the __repr__() for each object inside it. So it can be useful to define both, even if you decide to have them do the same thing. If you want __str__ and __repr__ to do the same thing

Re: Fwd: class print method...

2011-12-05 Thread Dave Angel
On 12/05/2011 07:41 AM, Lie Ryan wrote: On 12/05/2011 10:18 PM, Suresh Sharma wrote: Pls help its really frustrating -- Forwarded message -- From: Suresh Sharma Date: Monday, December 5, 2011 Subject: class print method... To: "d...@davea.name <mailto:d...@davea.name>

Re: Fwd: class print method...

2011-12-05 Thread Lie Ryan
On 12/05/2011 10:18 PM, Suresh Sharma wrote: Pls help its really frustrating -- Forwarded message -- From: Suresh Sharma Date: Monday, December 5, 2011 Subject: class print method... To: "d...@davea.name <mailto:d...@davea.name>" mailto:d...@davea.name>>

Re: class print method...

2011-12-05 Thread Chris Angelico
On Mon, Dec 5, 2011 at 10:18 PM, Suresh Sharma wrote: > > Suit=[aces,clubs,diamonds,hearts] > Rank=[2,3,4,5,6,7,8,9,j,Q,K,A] > class Card: > Def __init__(self,rannk,suiit): > Self.suiit=suiit > Self.rannk=rannk > > Def __str__(self): > Return suit[suiit],rank[rannk] > > Class deck: > Def __init__(

Fwd: class print method...

2011-12-05 Thread Suresh Sharma
Pls help its really frustrating -- Forwarded message -- From: Suresh Sharma Date: Monday, December 5, 2011 Subject: class print method... To: "d...@davea.name" Dave, Thanx for the quick response, i am sorry that i did not explain correctly look at the code below inspi

Re: class print method...

2011-12-04 Thread Dave Angel
On 12/05/2011 02:11 AM, Suresh Sharma wrote: Hello All, I am new to python and i have stuck up on a particular issue with classes, i understand this might be a very dumb question but please help me out. I have created two classes and whenever i try to print the objects i get this message but not

class print method...

2011-12-04 Thread Suresh Sharma
Hello All, I am new to python and i have stuck up on a particular issue with classes, i understand this might be a very dumb question but please help me out. I have created two classes and whenever i try to print the objects i get this message but not the data, __main__.cards instance at (mem