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
- 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.
list.append(value), list.extend(values),list.insert(location, value)
- 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 theclose()
method. BaseException
virtualenv
andvenv
Chapter 2 – System Programming Packages
- The operating system (os) module.
- The
subprocess.run()
method blocks the main process...