0% found this document useful (0 votes)
2 views30 pages

Introduction to Python Programming for AI

The document provides an introduction to Python programming for AI, covering its features, applications, and how to get started using Google Colab. It outlines key concepts such as data types, flow control, functions, and modules, along with practical exercises. The session concludes with a preview of the next module focused on Python libraries for AI development.

Uploaded by

Carlos Barbosa
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
0% found this document useful (0 votes)
2 views30 pages

Introduction to Python Programming for AI

The document provides an introduction to Python programming for AI, covering its features, applications, and how to get started using Google Colab. It outlines key concepts such as data types, flow control, functions, and modules, along with practical exercises. The session concludes with a preview of the next module focused on Python libraries for AI development.

Uploaded by

Carlos Barbosa
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 30

CAI1001C

AI Thinking
Introduction to Python Programming for AI
Disclaimer

Miami Dade College has adapted the content on the subsequent slides from the
AI for Current Workforce program, which is part of
Intel® Digital Readiness Programs.
Topics

1. What is Python?
2. Getting started with Python using Google Colab
3. Some Python exercises

3
What is Python?
What is Python?
• General purpose coding language
• Easy to learn and use
• Free!

5
Why are we using Python?
• Easy to read
• Huge repository of Libraries to use
• Flexible
• Quick to see results

Do you know of any other Programming Language?

6
Applications of Python

Here are some examples

• Data Science
• Business
• Games
• Artificial Intelligence

7
Getting Started

Applications

• Jupyter Notebook
Jupyter Notebook
• Anaconda
• repl.it
• Google Colab

Google Colab

8
Go to Google Colab

Sign In

Link here

9
Go to the Upload tab

10
Upload File
• Locate [Notebook - student] Module 3 (Introduction to Python).ipynb
• Let’s Begin!

11
Refer to your Notebook in Google Colab

Introduction to Python - Let’s Begin!

12
Python Comments
• Use the # symbol
• Everything after # in the same line will be a comment

13
Python Data Types
• Variables are “containers” for storing data values
• No need to declare variables in Python
• But an assigned value has a type

14
Numbers
• Syntax is similar to other programming languages
• Parentheses used for grouping, order or precedence

15
Lists
• Are an ordered sequence of items
• Can contain different data types

16
Strings
• Strings are a sequence of characters
• Python has functionality to manipulate strings

17
Data manipulation
• String concatenation
• Indexing
• Slicing

18
Tuples
• Are an ordered sequence of items
• Cannot be modified unlike Lists

19
Dictionary
• Unordered collection of key-value pairs
• Like a real dictionary, you look up a key to get its value
• Keys must be unique, values do not

20
Type Conversion
• Changing of one data type to another
• Implicit
• Explicit

21
Reflections
• What are the different data types we’ve seen and how are
they different from each other?
• Let’s discuss!

22
Flow Control
• If-else statements & loops
• Requires a condition
• Think of a traffic light, codes are only work when its “green”

23
Python Functions
• Looks neater
• Is a block of code
• Facilitates code reusability

24
Python Modules
• A File containing Python statements and definitions file.py
• Code manageability
• Facilitates code reusability

25
Python Packages
• Organized group of modules
• Works like a folder containing multiple documents
• Must contain an initialization file init.py

26
Let’s play Kahoot!

Go to the link.

2
27
7
Let’s do the exercises

Things to do
• Attempt the Exercises
• Can you tackle the bonus exercise?
• Feel free to use the Internet to look for
resources to complete the exercises

28
Reflections
• In what way would flow control be useful?
• Let’s discuss!

29
Any last words?

In the next module we will be diving into Python libraries to help us


with developing AI applications! Are you excited?

30

You might also like