Basics of Python using Jupyter Notebook

Part 2: Making Rules and Decisions with Conditional Logic

Sarah Mason
CodeX

--

Photo by Bruno Wolff on Unsplash

One of the top programming languages for often analytics and data fields is Python. Python can be used as an embedded function within local and cloud applications like Excel and Big Query. It has packages for extending functions and features. The basics of Python are the starting place for implementing capabilities from Python scripting and programming.

Starting with Python, picking the version, download Python app from python.org, the open-source community for Python. Packages for Python are available from multiple sources and PyPl.org is a major repository.

Decisions by Machine

The basics of Python include decision making by algorithms. The most simple forms are loops with conditional logic. Some of the types most used are FOR, IF, and IF ELSE. Conditional logic is defined as a way to provide different “choices” by giving conditions with actions.

FOR

Figure 1: Basic Python

The example shows a FOR statement. For each time the condition is met, an action is taken.

--

--