A brief intro to Python banner

The art of Python programming begins with a basic understanding of how the language works, the JupyterLab notebook environment, and the importance of developing a consistent coding style supported by clear documentation. These topics are covered in this first module, along with an initial look at the versatile Python string variable.

Topics

  • Variables and Memory
  • Order of Operations
  • Data Types
  • Libraries
  • Functions

Objectives

By the end of this module, students will be able to:

  • Understand Python’s dominance in data science and its role in high-performance computing.
  • Develop Python troubleshooting skills, including documentation referencing and error handling.
  • Write Python code adhering to best practices for operators, variables, and functions.
  • Utilize Python libraries through the import function and understand major AI libraries like TensorFlow and Keras.

Watch

Thumbnail screenshot of a Practicum AI video Video: Python Variables and Memory

Thumbnail screenshot of a Practicum AI video Video: Python Operators

Thumbnail screenshot of a Practicum AI video Video: Python Data Types

Thumbnail screenshot of a Practicum AI video Video: Functions

Thumbnail screenshot of a Practicum AI video Video: Coding style

Practice and Apply

In this section, you will work through a Jupyter Notebook and then take a knowledge quiz.

We will need to start a session in the computing environment you plan to use (e.g., HiPerGator or Google Colab) and then clone the Practicum AI Python for AI repository.

If you took our Computing for AI course, you have been through the steps of making your repository from our template and launching a session on HiPerGator of Google Colab. The sections below include a general summary of these steps and links to the detailed, step-by-step directions from the earlier course.

Step 1. Create your repository from the template

Detailed step-by-step instructions.

Step 2. Launch a HiPerGator or Google Colab session

Follow the instructions for the system you are using:

Launch a HiPerGator session

  • Log in to HiPerGatorLinks to an external site.
  • Click Jupyter Notebook
  • Resource request should be remembered from the last time, but here’s what you need:
    • Number of CPUs: 1 or 2
    • Maximum Memory: 15GB
    • SLURM Account and QOS: Group name as needed.
    • Time Requested: 2
    • Cluster Partition: default
  • Return to your copy of the template, click the <>Code button, the SSH link (assuming you have SSH keys set up from the Computing for AI course), and copy the URL. In Jupyter, click the Git tab on the left, and click “Clone a Repository”

Detailed step-by-step instructions for HiPerGator.

Launch a Google Colab session

  • Log into Colab.
  • This time, the repository we will use as the template is the Practicum AI: Python for AI.
  • From the File Menu select Open Notebook.
  • Click on the GitHub tab and then type your GitHub username followed by the name of the repository: e.g. username/python-for-ai.

Detailed step-by-step instructions for Google Colab.

Step 3: Work through the Notebook

Once you have cloned the repository, go ahead and work through Notebook 01_brief_intro_python.ipynb.

Optional Content / Additional Resources

Looking to learn more about Python? For our Practicum AI course, we identified the essential Python skills needed to get started with AI coding. We left a lot out! These resources provide additional details on the Python programming language.

Continue to Module 2.