Practice some Python programming
Our main objective this week is to ensure that you have a sufficient knowledge of the basics of Python programming to be able to use it effectively in this module.
This week we will follow the early sections of Google's Python class and do some of the Basic Exercises.
If you are already comfortable with Python, you might wish to look ahead at boto3 which is the API we will be using the coming weeks: https://boto3.readthedocs.io/.
Quoting from https://python.org, Python is "a programming language that lets you work more quickly and integrate your systems more effectively." For this reason Python is very popular with system administrators -- it combines the power of an object oriented programming language with the agility of a scripting language. It's quick and relatively easy to write small programs at the command line using a simple editor to do various useful things. There is no compilation step. It's also considered a good language for people who are relatively new to programming.
Verify that Python 3 is installed on your local machine (e.g. on Ubuntu VM). Just enter the "python3" command in a terminal window to launch an interactive interpreter:
python3
>>> print ('Hello, World!')
>>> quit()
The Google Python class contains a set of exercises in the form of self-testing programs that you are invited to download. We have created a modified version of these that is compatible with Python 3 which can be downloaded from here.
If you are interested, you can re-create this yourself using the 2to3 command to convert the original Python 2 files to Python 3.
Follow the Google Python class from here.
You can jump straight to the Introduction section.
Next, read the section on Strings and attempt the string1.py Basic Exercise
Next, read the section on Lists and attempt the list1.py Basic Exercise
If you have time, the next parts to look at are "Sorting", "Dicts and Files" and "Utilities". You can safely skip the section on Regular Expressions. However, for this week it is sufficient if you can get through "Strings" and "Lists" and successfully complete the exercises!