A Simple Point Class in python
<pre><code>Class Clock:   
    def __init__(self):
        self._hours = 12
        self._minutes = 0
        self._seconds = 0

    def getHours(self):
        return self._hours

    def getMinutes(self):
        return self._minutes

    def getSeconds(self):
        return self._seconds

    def show(self):
        print "%d:%02d:%02d" % (self._hours, self._minutes, self._seconds)
</code></pre>

<p>I want to add a method to this class called setTime which takes hours, minutes, and seconds as parameters and make appropriate changes to the object’s attributes.The following code makes use of this class and the method setTime.</p>

<pre><code>clk = Clock()
clk.setTime(12, 34, 2)
print clk.getHours()
clk.show()

    def setTime(self, hours = 12, minutes = 34, seconds = 2):
        self._hours = hours
        self._minutes = minutes
        self._seconds = seconds
</code></pre>

<p>My question is that am my setTime method correct? Also, how to check whether my function is correct or not?</p>

<p>Thank you!</p>
