• Online, Self-Paced
Course Description

Python is a lot more than a scripting language, and can be used to create OOP applications using classes, or using a functional paradigm. This course covers some of the ways Python programs can execute. You'll learn about building your own custom functions and classes, and documentation and file handling.

Learning Objectives

Modules and Functions

  • start the course
  • create and import a module at the Python REPL
  • define a function in Python
  • describe the difference in operation between Python scripts, programs and modules
  • run a module as a script using the __name__ == __main__ syntax in Python
  • create a main function that takes command line arguments in Python

Classes

  • describe the relationship between classes and types in Python
  • create a class definition and describe the structure in Python
  • write a class initializer method in Python
  • write and use class instance methods in Python
  • write and use static methods in Python
  • use inheritance and describe the semantics in Python
  • describe class properties in Python
  • describe how inheritance affects properties in Python
  • write a class that implements operator overloading in Python

Documenting Code

  • write docstrings in Python
  • write comments in Python
  • describe best practice for documenting Python code as set out in PEP 8

Files

  • read text files in Python
  • write data in Python
  • write large files in Python
  • read binary data in Python
  • write binary data in Python

Practice: Creating Classes

  • write a Python class to represent a vector

Framework Connections

The materials within this course focus on the Knowledge Skills and Abilities (KSAs) identified within the Specialty Areas listed below. Click to view Specialty Area details within the interactive National Cybersecurity Workforce Framework.

Feedback

If you would like to provide feedback for this course, please e-mail the NICCS SO at NICCS@hq.dhs.gov.