COM 325
Artificial Intelligence
1
Programming with Python
• Integrated Development Environment (IDE)
• Visual Studio Code
• Developed by Microsoft
• Free
• Available for download at: [Link]
• Supports Python, as well as many other programming languages
2
Programming with Python
• Python
• Developed by Guido Van Rossum in the 1980s
• Available at: [Link]
• High level programming language
• Interpreted language
• Object Oriented
• Inheritance
• Polymorphism
• Encapsulation
• Used for a multitude of applications
• Software development
• Game development
• Web development
• Much more
3
Programming with Python
• VS Code and Python
4
Programming with Python
• Python Syntax
• Data Types and Variables
• Python is dynamically typed
5
Programming with Python
• Python Syntax
• Functions
6
Programming with Python
• Python Syntax
• Arrays
7
Programming with Python
• Python Syntax
• Arrays
8
Programming with Python
• Python Syntax
• If statements
9
Programming with Python
• Python Syntax
• While Loop
10
Programming with Python
• Python Syntax
• For Loop
11
Programming with Python
• Python Syntax
• User Input (Console)
• Using the print() method which returns a string
12
Programming with Python
• Python Syntax
• Classes
• Declared with the class keyword
13
Programming with Python
• Python Syntax
• Classes
• Object Instantiation
14
Programming with Python
• Python Syntax
• Classes
• Constructors
• Special class method that can be used to initialize member data
• Can take parameters
• __init__
15
Programming with Python
• Python Syntax
• Classes
• Constructors
16
Programming with Python
• Python Syntax
• Classes
• Destructor
• Special class method called when an object is destroyed
• Used to free resources
• A class only has one destructor and does not take any arguments
• Cannot be explicitly called
• __del__
17
Programming with Python
• Python Syntax
• Classes
• Inheritance
18
Programming with Python
• Python Syntax
• Classes
• Inheritance
19
Programming with Python
• Python Syntax
• Main function
20
Programming with Python
• Debugging
• Breakpoints
21
END
22