CSCA08H3 Study Guide - Final Guide: Expected Return, White-Box Testing, Instance Variable

252 views15 pages

Document Summary

Defines everything about the data: what is held in the class, how it is held in the class, eg. Format, calculation etc: what it does, eg. Functionality of the class: defining methods -> Similar to functions but are part of class. Functionality exists in that method, then decides what the method does. __init__ method allows the user to define what parameters are given: creating objects of that type -> Allows user to create objects aligning to the variables implemented: self -> My_object. my_method(a,b,c) : the usual form for methods, where (a, b, c) are parameters, my_object is the object name, my_method is the method name. Python is able to access it by the class. Self is the object you are working with that you are going to access in some way: documentation, class level docstring: String explains the documentation, just like normal docstring for functions. Concise but accurate and explaining what it does. Type, requirements, examples not needed: methods docstring: