Book Image

Sage Beginner's Guide

By : Craig Finch
1 (1)
Book Image

Sage Beginner's Guide

1 (1)
By: Craig Finch

Overview of this book

Table of Contents (17 chapters)
Sage Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


This chapter introduced you to the principles of object-oriented programming. You have learned how to create classes in Python, and how to use them to organize your code. We also touched on some general software engineering principles, including the concept of unit testing. Specifically, we:

  • Defined classes to represent an armoured fighting vehicle

  • Used inheritance to represent other types of military vehicles

  • Organized the class definitions into modules

  • Created a package to contain our modules

  • Learned how to handle exceptions

  • Defined our own exceptions specific to the Vehicle and Tank classes

  • Created unit tests to make sure our classes are working correctly

Now, we'll move on to some advanced techniques to help you get the most out of Sage.