Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #73901

Re: OOP with MyTime

References <7020a5d8-96a9-4fa4-8e69-4c7593dedee3@googlegroups.com> <mailman.11418.1404331330.18130.python-list@python.org> <fd30a5f9-c446-435a-9f0a-74dd2d608c5c@googlegroups.com>
Date 2014-07-03 23:01 +1000
Subject Re: OOP with MyTime
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.11457.1404392478.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Thu, Jul 3, 2014 at 10:51 PM,  <kjakupak@gmail.com> wrote:
> So I've now gotten this:
> class MyTime:
>     def between(self, t1, t2):
>         return (t1.hours, t1.minutes, t1.seconds) <= (self.hours, self.minutes, self.seconds) and (self.hours, self.minutes, self.seconds) <= (t2.hours, t2.minutes, t2.seconds)
> print("between(t2, t3, t1) =", between(t2, t3, t1))

And what happens when you run this code? A NameError, I would expect.
Do you understand how to define and call methods?

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

OOP with MyTime kjakupak@gmail.com - 2014-07-02 12:20 -0700
  Re: OOP with MyTime Akira Li <4kir4.1i@gmail.com> - 2014-07-02 23:45 +0400
  Re: OOP with MyTime MRAB <python@mrabarnett.plus.com> - 2014-07-02 21:02 +0100
    Re: OOP with MyTime kjakupak@gmail.com - 2014-07-03 05:51 -0700
      Re: OOP with MyTime Chris Angelico <rosuav@gmail.com> - 2014-07-03 23:01 +1000
        Re: OOP with MyTime kjakupak@gmail.com - 2014-07-03 06:08 -0700
          Re: OOP with MyTime Chris Angelico <rosuav@gmail.com> - 2014-07-03 23:17 +1000
      Re: OOP with MyTime MRAB <python@mrabarnett.plus.com> - 2014-07-03 14:11 +0100
        Re: OOP with MyTime kjakupak@gmail.com - 2014-07-03 08:21 -0700
          Re: OOP with MyTime Chris Angelico <rosuav@gmail.com> - 2014-07-04 01:35 +1000
          Re: OOP with MyTime Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-07-03 17:23 +0100

csiph-web