Wednesday, September 9, 2015

Get Classy


Instead of jumping directly to assignment 2, I decided to complete a suggested "refresher" listed on assignment 1: Introduction to Python on CodeAcademy.com.  While I've taken some very basic coding classes in the past, "Introduction to Python" taught me about Classes and Methods.  Classes are a roadmap to how related Objects function.  I created an Animal Class with Methods (functions within a Class) describing running, resting, and recovering behavior.  I then created a Human Object and a Cheetah Object.  I plugged both objects into my Class and observed their behavior.  Turns out a human running at 10 miles per hour would pass a Cheetah sprinting and resting after only a few hours.  Even if the human rested once an hour, they would pass the Cheetah in less than 10 hours.  If you would like to compare two animals, comment on this post with their running speed, running time, resting speed, resting time, and recovery percent.  I'd be happy to run my Class!