/Python_Fundamentals

We are trying to explore the world of Python in this repository and learn how to become a "Pythonic" programmer.

Primary LanguageJupyter NotebookMIT LicenseMIT

Python Fundamentals

In this repository, we explore the world of Python and learn how to become a "Pythonic" programmer. We use "Jupyter Notebook" as our execution environment in this project. You can follow the installation instructions for Anaconda below and start using Jupyter Notebook for coding in this project.

Installing Jupyter Notebook

Before starting to write code in Python, we need to first setup the development environment, which include an interpreter, standard library, and other environment settings. For people who want to use the official Python development environment, you can download it from Python official web page, www.python.org. However, the IDLE (Integrated Developmnet and Learning Environment) provided by Python is not the most intuitive one to use for developers or programmers. Here we adotp to a more complete standard platform called "Anaconda" and using "Jupyter Notebook" as our development environment. Jupyter Notebook is an open-source web-based development environment for coding. It supports over 40 programming languages, includes Python, R, Julia, and Scala.

We can download Anaconda from the official web page, www.anaconda.com, by click on "Download". anaconda 1

Choose the latest version Python 3.7 to complete downloading the installer. For Mac or Linus users, you can choose the cooresponding installer by clicking the "macOS" or "Linus" logo on top of the page. Follow the instructions to complete the installation. Note: Anaconda is a massive package to install, it requires at least 3GB of space from your machine to install the package. Please check the memory space in your machine before installing. anaconda 2

After installation, we can launch Anaconda Navigator from Window Start Menu. The Anaconda Navigator contains several program IDEs such as VS Code, Spyder, PyCharm, R-studio, etc. You can start a Jupyter Notebook by clicking the "Launch" button under Jupyter Notebook. anaconda 3

Jupyter Notebook is a web-based IDE, so it starts the Notebook Dashboard by opening the default web browser, which will show a list of the notebooks, files, and subdirectories int he directory where the notebook server was started. You should start a project by identifying the directory for the project. For instance, step 1, you can start a project directory on desktop, which will create a folder on your desktop. Step 2, click on "New" drop down menue. Step 3, create a new python notebook in that folder (or directory) by choosing "Python 3". anaconda 4

Once you created a new Python notebook file, step 1, you can give a name to the notebook file by clicking "Untitled" and replace with a new file name. Step 2, choose the coding type for the coding block. If you are writing Python code in a specific block, make sure "Code" is chosen in the drop down menu. You can also choose "Markdown" if you are trying to create a markdown in the document. Step 3, start coding in the coding block.
anaconda 5

Lesson 1 - Basic Coding Syntax and Structure in Python

  • 1.1 - Coding Structure
  • 1.2 - Comment between Codes
  • 1.3 - Assignment
  • 1.4 - Mathematical Operations
  • 1.5 - String
  • 1.6 - Number
  • 1.7 - None
  • 1.8 - Input
  • 1.9 - Basic Style Guide for Python Code

Lesson 2 - Basic Data Structures in Python

  • 2.1 - List
  • 2.2 - Index and Slice
  • 2.3 - Methods of List Object
  • 2.4 - List Sort
  • 2.5 - Other List Operations
  • 2.6 - Multi-Layer List and DeepCopy
  • 2.7 - Tuple
  • 2.8 - Set

Lesson 3 - String Processing in Python

  • 3.1 - Sequence
  • 3.2 - Basic String Operations
  • 3.3 - Escape Character & Escape Sequences
  • 3.4 - Methods of String Object
  • 3.5 - String Search
  • 3.6 - String Modification
  • 3.7 - Transforming Object into String
  • 3.8 - Formatting a String Object
  • 3.9 - f-strings
  • 3.10 - bytes Object

Lesson 4 - Dictionary

  • 4.1 - What is a Dictionary?
  • 4.2 - Methods of Dictionary Object
  • 4.3 - Word Counter
  • 4.4 - What object can be a "key"?
  • 4.5 - Sparse Matrix
  • 4.6 - Using Dictionary as Cache
  • 4.7 - Dictionary Efficiency

Lesson 5 - Control Flow Tools

  • 5.1 - While Loop
  • 5.2 - if-elif-else Condition Statements
  • 5.3 - For Loop
  • 5.4 - Comprehension and Generator
  • 5.5 - Boolean Test
  • 5.6 - Simple Program for Textual Analysis

Copyright © 2020 Norman Lo