INFO1110 Lecture Notes - Lecture 5: Order Of Merit
Document Summary
# no need to create a circle instance to call class method print(circle. get_pi()) # create a circle instance with radius 2 c1 = circle(2) # you can only call this method on instances of circle print(c1. calculate_area()) Both instance methods and class methods can take in additional parameters within their de nitions. Test-driven development (tdd) is about writing tests before you begin implementing your program. Why: tests are written to the speci cation, rather than the implementation, can help you make api design decisions. What methods should the class have: helps you de ne and/or understand the behaviour of the code before you go to implement it.