Re: Newbie learning OOP

2005-06-01 Thread Terry Hancock
On Sunday 29 May 2005 03:18 pm, John Machin wrote: > LenS wrote: > > Trying to learn OOP concepts and decided to use Python for this > > purpose. I have coded the following CLASS and it seems to work fine. > > Any comments on the code or suggestions would be appreciated. > A practical problem: no

Re: Newbie learning OOP 2nd ?

2005-05-30 Thread LenS
Thank you for your suggestion and especially your time. I will study your code:-) Len Sumnler -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie learning OOP 2nd ?

2005-05-30 Thread [EMAIL PROTECTED]
I would split your code such that the Q&A is seperated from the calculations, and I would model the bill something like : class allbills(object): def __init__(self, bill, tip): self._bill = bill self._tip = tip def gettip(self): return self._tip / 100.0 tip = p

Re: Newbie learning OOP

2005-05-30 Thread LenS
You are correct, the code so far is just a simple problem to learn OOP. Oh by the way I don't work for Dept. of Homeland Security just remember "drop those fingernail clipers and step away from those shoes:-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie learning OOP

2005-05-30 Thread LenS
Thanks for the reply. I will be looking over you code. I'm trying to learn OOP. It just hasn't sunk in yet;-\ -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie learning OOP

2005-05-29 Thread John Machin
LenS wrote: > Trying to learn OOP concepts and decided to use Python for this > purpose. I have coded the following CLASS and it seems to work fine. > Any comments on the code or suggestions would be appreciated. > > The class let you take a person's name and split it up into first last > and mid

Re: Newbie learning OOP

2005-05-29 Thread Steven Bethard
LenS wrote: > class names: > def __init__(self, format = "F"): > self.format = format > > def namesplit(self, name): > if self.format == "F": > self.namelist = name.split() > self.first = self.namelist[0] > self.init = self.namelist[1] >