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
Thank you for your suggestion and especially your time. I will study
your code:-)
Len Sumnler
--
http://mail.python.org/mailman/listinfo/python-list
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
I have coded this little program which is a small little tip calculator
program. I am in the process of trying to convert this program to use
OOP. Would appreciate others more experienced in OOP code in how they
might do it.
Would be happy to forward all profits from the sale of the program;-))
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
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
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
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]
>
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 middle. The class defaults