Beginning to Code with Python: Notes, Examples and Exercises
This repository contains code fragments, notes and exercises from the book Begin to Code With Python by Rob Miles. The book is available at the official Microsoft Press Store.
I started this repository to work through an easy and basic book before working on some more intermediate level python projects and books.
Contents
Part 1. Programming Fundamentals
Part 2. Advanced Programming
Part 3. Useful Python
Useful Python
Important
Chapter 1 only provides basic information on installing python and assumes a Windows environment so is not covered in these notes
Python Version and Writing Style
- The original book was written with python 2.X and python 3.6 in mind.
- Currently we’ve written the code using python 3.12.
- Small changes have been made to the supplied code to resolve the following issues:
snapsget_stringfunction not allowing the user to actually supply inputsnapsdisplay_imagemodified to deal with issues where.pngfiles might not display
- In general the code style of the solutions is restricted to elements of the python language introduced up until that point
- For some of the extension exercises we have gone beyond that by still restricting ourselves to concepts that have been introduced, e.g
- We use
random.choiceto select random items from a list, after having been exposed to both therandomandlistlibraries - We use the string method
findafter having been introduced to the concept of string methods and substrings searching withstartswith - We use the
datetimemodule to simplify arithmetic on date and time objects after having extensively used thetimemodule - The final Banking Application example in Chapter 13 uses some tkinter elements that are not discussed,but are documented online
- We use
- For some of the extension exercises we have gone beyond that by still restricting ourselves to concepts that have been introduced, e.g