Skip to content

Commit

Permalink
Merge pull request #171 from anharrington/master
Browse files Browse the repository at this point in the history
instance method limbs not class method for Animal class
  • Loading branch information
bnmnetp authored Jan 14, 2019
2 parents e583681 + c7c87ed commit 1910bac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion _sources/Classes/AddingOtherMethodstoourClass.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ have one additional parameter as compared to the invocation.

**Check Your Understanding**

1. Create a class called Animal that accepts two numbers as inputs and assigns them respevtively to two instance variables: ``arms`` and ``legs``. Create a class method called ``limbs`` that, when called, returns the total number of limbs the animal has. To the variable name ``spider``, assign an instance of ``Animal`` that has 4 arms and 4 legs. Call the limbs method on the ``spider`` instance and save the result to the variable name ``spidlimbs``.
1. Create a class called Animal that accepts two numbers as inputs and assigns them respevtively to two instance variables: ``arms`` and ``legs``. Create an instance method called ``limbs`` that, when called, returns the total number of limbs the animal has. To the variable name ``spider``, assign an instance of ``Animal`` that has 4 arms and 4 legs. Call the limbs method on the ``spider`` instance and save the result to the variable name ``spidlimbs``.

.. activecode:: ac_chp13_classes_01
:tags: Classes/ImprovingourConstructor.rst, Classes/AddingOtherMethodstoourClass.rs
Expand Down

0 comments on commit 1910bac

Please sign in to comment.