Advanced Data Structure Usage

Overview

In this lab, we will expand our knowledge of data structures, digging into the dictionary. We will again work with logic to include compound conditions. We’ll use a real-life information security scenario by reading and parsing a Linux log file for ssh dictionary attacks, an all-to-common threat in the wild.

outcomes:

In this lab, you will learn to:

  • Read a text file and parse the data from it using string methods.
  • Examine the list data structure in more detail.
  • Examine the Python dictionary data structure (aka “associative array” or “hash”).
    • Review logic compound conditions.

Key terms and descriptions

dictionary
Dictionaries are used to store data values in key:value pairs.A dictionary is a collection which is ordered*, changeable and does not allow duplicates.
list
Lists are used to store multiple items in a single variable.
Logic operators
Logic operators allow you to create compound conditions that evaluate to true or false.