To Lecture Notes

IT 211 -- Mar 11, 2019

Review Exercises

  1. Explain the differences between a dict class and a user defined class.
  2. Give the definition of each of these items:

         Class Name   Instance Variable   Instance Method   Public Member

         Private Member  Dunder Method   Constructor   Local Variable 

         Standalone  Method   Parameter   Argument    Constant
    Ans:
    Class Name: the name of the class set by the first line of the class file.
    Instance Variable: Variables that are part of the data for the class. They each have a self. prefix.
    Instance Method: Methods that are called by an object from the class.  They have self as their first parameter.
    Public Member: A public member can be called anywhere, including in the test class.
    Private Member: A private member should only be called within the code for the class.
    Dunder Method: Has a double underscore prefix and suffix, like __init__ or __str__.
    Constructor: A standalone method, having the same name as the class, that creates a new object from that class.
    Local Variable: A variable that is defined and is only valid within a particular method.
    Standalone Method: A method that is not called from an object, such as print or open. Constructors are always standalone methods.
    Parameter: A value that is passed into a method in the method definition.
    Argument: A vallue that is passed into a method when the method is called.
    Constant: A value that cannot be changed, like "dog", 3456, 2.543, False.

More about Classes

Project 7

Turtle Graphics