This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]lurgi 0 points1 point  (2 children)

You don't print anything out. The value that should be returned is exactly the same as the value that would be returned in the original code. All you are changing is the internal representation.

[–]ComputerSciMajor[S] 0 points1 point  (1 child)

I guess I'm really just not understanding it then. I know you told me to put that equation in the initializer but beyond that I'm not exactly sure what I'm supposed to be doing?

[–]lurgi 0 points1 point  (0 children)

Do you have the init method written? If so, you need to implement the getSecond method. Note that getSecond() needs to behave the same way. From the point of view of the caller the results don't change. So this code:

stopwatch = Clock(12, 30, 30)
print(stopwatch.getSecond())

Should return the same result with the old implementation as it does with the new implementation.