15

Assessments – Answers to the End-of-Chapter Questions

In the following pages, we will provide answers to the practice questions from the end of each of the chapters in this book and provide the correct answers.

Chapter 1 – Working with Python Scripting

  1. The Python dictionary data structure provides a hash table that can store any number of Python objects. The dictionary consists of pairs of items containing a key and a value.
  2. list.append(value), list.extend(values),list.insert(location, value)
  3. Using the context manager approach, the with statement automatically closes the file even if an exception is raised. Using this approach, we have the advantage that the file is closed automatically, and we don’t need to call the close() method.
  4. BaseException ...

Get Python for Security and Networking - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.