Programming and Algorithms for Intelligent Systems
Introduction
Dr. Zein Salah
College of IT and CE
Palestine Polytechnic University
Me
Zein Salah
• B.Sc.: Palestine Polytechnic University
Introduction
• M.Sc.: University of Jordan
• Ph.D.: University of Tübingen, Germany
Room: Building C, Room C201
Office Hours:
Sun, Tue, Thu: 9:30-13:30
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
This Course
What you should bring:
• Algorithmic thinking
• Willing to learn programming
Introduction
What you will learn:
• Programming concepts
• Developing programs in Python
• Problem solving
• Dealing with ML related problems
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
This Course
What you should bring: This course contains:
• Algorithmic thinking
Theoretical Part:
• Willing to learn programming
Introduction
• Background, Concepts, Algorithms,
…
What you will learn:
Practical Part:
• Programming concepts • Programming
• Developing programs in Python • A slut in a modern lab is reserved
for. You are highly encouraged to
• Problem solving
utilize this
• Dealing with ML related problems
• AS IMPORTANT AS THE
THEORETICAL PART
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Programming Languages
• There are around 700 programming languages
• https://en.wikipedia.org/wiki/List_of_programming_languages
Introduction
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Programming Languages
• P.L. are used to control the behavior of a (programmable) device,
e.g., a computer
• Conform to syntax and semantics
Introduction
• Why different P.L.?
- Different tools for different jobs
- Taste issue?
• Many perspectives to compare different P.L.
• We consider here:
• How the language deals with certain problems
• How the language manages/deals with data
• Python
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Python
Why Python?
Introduction
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Python
Why Python?
• Oriented toward developer
Introduction
productivity
• Extensive libraries (aka packages) for (almost) every application field
• Free and open source
• Platform independent Python vs. C/C++?
• Can be treated as a procedural, • Oriented toward developer
object-oriented, or functional language! productivity
• C/C++ is faster at low-level
• Good Community! programming
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Literature
Hardly countable references
Introduction
• Fundamentals of Python First Programs, 2nd Edition, Kenneth A.
Lambert, 2019
• Fundamentals Of Python Data Structures, Kenneth A. Lambert, 2019
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Introduction Python, learning a programming language
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Introduction Python, learning a programming language
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Introduction Python, learning a programming language
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Introduction Python, learning a programming language
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Introduction Python, learning a programming language
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
How it works made simple
Python Interpreter: a software (program) that executes the python source
code line by line
Introduction
Interpreter
Machine code
Python source code
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
What do we need?
• Install Python:
• Download from https://www.python.org/
• Make sure it is Python 3! Not backward compatible. Python 2 is not supported
Introduction
since 01.01.2020
• Better: download and install anaconda from https://www.anaconda.com/distribution/
• You can:
• Use command line / PowerShell etc.
• Code editor ➔ Interpreter (within Command Line / PowerShell etc.)
• Use an IDE (e.g. PyCharm)
• There are still other options!
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Let’s write something
“Hello World” program:
Introduction
• Use command line
• Code editor ➔ interpreter
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Let’s write something
“Hello World” program:
Introduction
• Use an IDE (PyCharm)
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
Let’s write something
“Hello World” program:
Introduction
repl.it
• Online IDE
• Supports 40 P.L.
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
This Course
Activity Topics
Course Outline 1 Introduction
2 Data Types
3 Conditional Logic
Introduction
4 Version Control
5 Loops
6 Functions
7 Customized Data Structures
8 Object-Oriented Programming
9 Functional Programming
10 File IO
Midterm Exam
11 Decorators
12 Error Handling
13 Debugging
14 Algorithms and Problem Solving
15 Selected Applications and Problems
Final Exam
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022
My Recommendations
• Practice, practice, and practice!
• Test it yourself
• Create your own problems
Introduction
• Make your own homework
• Already know a P.L.? Great but don’t get stuck with
• Make use of Python Documentation
• Work in Teams
• Use version control
• Don’t print out slides
Prog. & Alg. for Intelligent Systems, Zein Salah, 2022