working through examples on DevNet at
developer.cisco.com. This chapter and the several that
follow provide a crash course in functional Python to get
you going with the basics you need for success on the
exam.
Many UNIX-based operating systems, such as Mac and
Linux, already have Python installed, but with Windows,
you need to install it yourself. This used to be a hassle,
but now you can even install Python from the Windows
Store. On a Mac, the default version of Python is 2.7, and
you should update it to the more current 3.8 version.
One of the easiest ways is to head over to python.org and
download the latest variant from the source. The
installation is fast, and there are many tutorials on the
Internet that walk you through the process.
Note
Why would a Mac have such an old version of Python?
Well, that’s a question for Apple to answer, but from a
community standpoint, the move to version 3
historically was slow to happen because many of the
Python extensions (modules) where not updated to the
newer version. If you run across code for a 2.x version,
you will find differences in syntax and commands (also
known as the Python standard library) that will
prevent that code from running under 3.x. Python is
not backward compatible without modifications. In
addition, many Python programs require additional
modules that are installed to add functionality to
Python that aren’t available in the standard library. If
you have a program that was written for a specific
module version, but you have the latest version of
Python installed on your machine, the program might
not work properly. You will learn more about common
Python modules and how to use them in Chapter 4,
“Python Functions, Classes, and Modules.”