The readings for Tuesday, January 26 are:
Once you have completed these readings, please answer the following questions:
Describe the general goals and principles of Object-oriented programming and how it compares to procedure-oriented programming.
What exactly is a class and what is an object?
What are fields and methods?
Given the class below:
class Dog(object): # Thanks, Dan def bark(self, n=1): ''' Bark n times ''' for i in range(n): print 'Arf!'
What is the self
argument in the bark
method? Why is it called
this and what does it refer to?
Given the class above, write code to do the following:
# 1. Create an instance of the Dog class # 2. Use this instance to bark 5 times
If you have any questions, comments, or concerns regarding the course, please provide your feedback at the end of your response.
To submit your response, please commit your work (responses and scripts) to the reading02 folder of your your Readings Bitbucket repository.
The instructor has modified the layout of the readings repository to have a
folder for each reading. You may wish to do a git pull
first to get this
updated layout.