SlideShare a Scribd company logo
Little Intro
❏ Raza Ul Mustafa, PhD - Computer Engineering
❏ Research areas: NLP, Video, Quality of Experience, Quality
of Service, Machine & Deep Learning
❏ Publications - 20 + → Languages used in my papers:
Python :)
❏ Main Courses of Interests: Programming
❏ Python, Web-programming, C/C++, Linux
❏ Worked & Working on Research Projects: 3+
Books
- The primary text for this course is a freely available online textbook called
Think Python: How to Think like a Computer Scientist.
- We will be using the interactive version of the text that is available through
Runestone Academy at https://runestone.academy.
Outline of course - Main topics
1. Variables & Operations
2. Strings & Numbers
3. Functions
4. Conditions / If/Elif/Else
5. Iterations – Very Important
6. Lists, Dictionaries, Tuples – Important in Python
7. Recursion, Sorting
8. OOP – Very important in all languages
Chapter 1
Software to Install
- Anaconda & Spyder
Windows Installation -
https://docs.anaconda.com/free/anaconda/install/win
dows/
Mac Installation -
https://docs.anaconda.com/free/anaconda/install/mac
-os/
Linux -
https://docs.anaconda.com/free/anaconda/install/linu
x/
First program
print("Hello, World!")
The way of program
❏ The single most important skill for a computer scientist is problem solving
❏ A program is a sequence of instructions that specifies how to perform a
computation.
Algorithms
- If problem solving is a central part of computer science, then the solutions that
you create through the problem solving process are also important.
- In computer science, we refer to these solutions as algorithms.
- An algorithm is a step by step list of instructions that if followed exactly will
solve the problem under consideration.
Our goal in computer science is to take a problem and develop
an algorithm that can serve as a general solution
The python programming languages
Python is an example of a high-level language; other high-level
languages you might have heard of are C++, PHP, and Java.
High Level Languages: They are very easy to understand, i.e.,
resembles natural language or mathematical notation and is
designed to reflect the requirements of a problem
Low Level Languages: They are also called machine-level
languages. 0101
Advantages of high level languages
- First, it is much easier to program in a high-level language.
- Programs written in a high-level language take less time to
write, they are shorter and easier to read, and they are
more likely to be correct.
- High-level languages are portable, meaning that they can
run on different kinds of computers with few or no
modifications.
Then who process the codes?
Two kinds of programs process high-level languages into
low-level languages: interpreters and compilers.
- Interpreters: An interpreter reads a high-level program and
executes it, meaning that it does what the program says.
- Compiler: A compiler reads the program and translates it
completely before the program starts running.
- In this case, the high-level program is called the source code, and the
translated program is called the object code or the executable.
Python Interpreter (1/2)
There are two ways to use the Python interpreter: shell mode and
program mode.
In shell mode, you type Python expressions into the Python shell, and the
interpreter immediately shows the result. The example below shows the
Python shell at work.
Python Interpreter (2/2)
Program mode: Alternatively, you can write an entire
program by placing lines of Python instructions in a file and
then use the interpreter to execute the contents of the file as
a whole. Such a file is often referred to as source code.
Saving and extension
By convention, files that contain Python programs
have names that end with .py.
Following this convention will help your operating
system and other programs identify a file as
containing python code.
What is debugging
Programming is a complex process. Since it is done by human
beings, errors may often occur.
Programming errors are called bugs and the process of tracking
them down and correcting them is called debugging.
● syntax errors,
● runtime errors,
● semantic errors.
Syntax errors
Python can only execute a program if the program is
syntactically correct; otherwise, the process fails and returns
an error message.
Syntax refers to the structure of a program and the rules
about that structure
Example – Next slide
Syntax errors example
Runtime errors
❏ The second type of error is a runtime error, so called
because the error does not appear until you run the
program.
❏ These errors are also called exceptions because they usually
indicate that something exceptional (and bad) has happened.
Runtime errors example
Semantic errors
- The third type of error is the semantic error.
- If there is a semantic error in your program, it will run
successfully in the sense that the computer will not generate
any error messages.
- However, your program will not do the right thing. It will
do something else. Specifically, it will do what you told it to
do.
Semantic errors example
Experimental debugging
One of the most important skills you will acquire is debugging.
Although it can be frustrating, debugging is one of the most
intellectually rich, challenging, and interesting parts of
programming.
Advice: Visualize
Comments in python
A comment in a computer program is text that is intended only for
the human reader - it is completely ignored by the interpreter. In
Python, the # token starts a comment. The rest of the line is
ignored. Here is a new version of Hello, World!.
Chapter python notebook:
All material available on Canvas
Ad

Recommended

PPTX
Python Intro Slides for Students CSC-148 Chapter 1
Raza Ul Mustafa
 
PPTX
Cmp2412 programming principles
NIKANOR THOMAS
 
PPTX
Exploring Data Science Using Python Tools
mohankamalhbec24
 
PPTX
Python-Mastering-the-Language-of-Data-Science.pptx
dmdHaneef
 
PPT
presentation_intro_to_python
gunanandJha2
 
PPT
presentation_intro_to_python_1462930390_181219.ppt
MohitChaudhary637683
 
PDF
Learn to Code with MIT App Inventor ( PDFDrive ).pdf
NemoPalleschi
 
PPTX
Python for dummies
Roberto Stefanetti
 
PPTX
Python Lecture 1
Inzamam Baig
 
PDF
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
PDF
From Basics to Advanced: A Comprehensive Python Programming Guide
pallavichauhan2525
 
PDF
Python for Physical Science.pdf
MarilouANDERSON
 
PPTX
Module1-Chapter1_ppt.pptx
SandeepR95
 
PPT
Introduction to python
Ranjith kumar
 
PDF
First Steps in Python Programming
Dozie Agbo
 
DOCX
A Introduction Book of python For Beginners.docx
kumarrabinderkumar77
 
PDF
python-handbook.pdf
RaviKumar76265
 
PPTX
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
PPT
Introduction to Python For Diploma Students
SanjaySampat1
 
PPTX
Python basics
ssuser4e32df
 
PDF
Introduction to Python.pdf
Rahul Mogal
 
PPTX
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Nandakumar P
 
PDF
What is Python? (Silicon Valley CodeCamp 2014)
wesley chun
 
PPTX
MODULE 1.pptx
KPDDRAVIDIAN
 
PDF
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Niraj Bharambe
 
PDF
CPPDS Slide.pdf
Fadlie Ahdon
 
PPTX
Python_Introduction&DataType.pptx
HaythamBarakeh1
 
PDF
introduction of python in data science
bhavesh lande
 
PPTX
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
Taqyea
 
PPTX
Presentation by Tariq & Mohammed (1).pptx
AbooddSandoqaa
 

More Related Content

Similar to Introduction to Python - Algorithm Compiler (20)

PPTX
Python Lecture 1
Inzamam Baig
 
PDF
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
PDF
From Basics to Advanced: A Comprehensive Python Programming Guide
pallavichauhan2525
 
PDF
Python for Physical Science.pdf
MarilouANDERSON
 
PPTX
Module1-Chapter1_ppt.pptx
SandeepR95
 
PPT
Introduction to python
Ranjith kumar
 
PDF
First Steps in Python Programming
Dozie Agbo
 
DOCX
A Introduction Book of python For Beginners.docx
kumarrabinderkumar77
 
PDF
python-handbook.pdf
RaviKumar76265
 
PPTX
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
PPT
Introduction to Python For Diploma Students
SanjaySampat1
 
PPTX
Python basics
ssuser4e32df
 
PDF
Introduction to Python.pdf
Rahul Mogal
 
PPTX
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Nandakumar P
 
PDF
What is Python? (Silicon Valley CodeCamp 2014)
wesley chun
 
PPTX
MODULE 1.pptx
KPDDRAVIDIAN
 
PDF
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Niraj Bharambe
 
PDF
CPPDS Slide.pdf
Fadlie Ahdon
 
PPTX
Python_Introduction&DataType.pptx
HaythamBarakeh1
 
PDF
introduction of python in data science
bhavesh lande
 
Python Lecture 1
Inzamam Baig
 
What is Python? (Silicon Valley CodeCamp 2015)
wesley chun
 
From Basics to Advanced: A Comprehensive Python Programming Guide
pallavichauhan2525
 
Python for Physical Science.pdf
MarilouANDERSON
 
Module1-Chapter1_ppt.pptx
SandeepR95
 
Introduction to python
Ranjith kumar
 
First Steps in Python Programming
Dozie Agbo
 
A Introduction Book of python For Beginners.docx
kumarrabinderkumar77
 
python-handbook.pdf
RaviKumar76265
 
2024-25 TYBSC(CS)-PYTHON_PROG_ControlStructure.pptx
sangeeta borde
 
Introduction to Python For Diploma Students
SanjaySampat1
 
Python basics
ssuser4e32df
 
Introduction to Python.pdf
Rahul Mogal
 
UNIT-1 : 20ACS04 – PROBLEM SOLVING AND PROGRAMMING USING PYTHON
Nandakumar P
 
What is Python? (Silicon Valley CodeCamp 2014)
wesley chun
 
MODULE 1.pptx
KPDDRAVIDIAN
 
Python Book/Notes For Python Book/Notes For S.Y.B.Sc. I.T.
Niraj Bharambe
 
CPPDS Slide.pdf
Fadlie Ahdon
 
Python_Introduction&DataType.pptx
HaythamBarakeh1
 
introduction of python in data science
bhavesh lande
 

Recently uploaded (20)

PPTX
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
Taqyea
 
PPTX
Presentation by Tariq & Mohammed (1).pptx
AbooddSandoqaa
 
PDF
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
jed P
 
PDF
Informatics Market Insights AI Workforce.pdf
karizaroxx
 
PPTX
Indigo_Airlines_Strategy_Presentation.pptx
mukeshpurohit991
 
DOCX
The Influence off Flexible Work Policies
sales480687
 
PPTX
Flextronics Employee Safety Data-Project-2.pptx
kilarihemadri
 
PPTX
Communication_Skills_Class10_Visual.pptx
namanrastogi70555
 
PPTX
美国毕业证范本中华盛顿大学学位证书CWU学生卡购买
Taqyea
 
PPTX
最新版意大利米兰大学毕业证(UNIMI毕业证书)原版定制
taqyea
 
PDF
Predicting Titanic Survival Presentation
praxyfarhana
 
PDF
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
Tamanna36
 
PPTX
Daily, Weekly, Monthly Report MTC March 2025.pptx
PanjiDewaPamungkas1
 
PPT
Reliability Monitoring of Aircrfat commerce
Rizk2
 
PPTX
Crafting-Research-Recommendations Grade 12.pptx
DaryllWhere
 
PPTX
Mynd company all details what they are doing a
AniketKadam40952
 
PDF
Boost Business Efficiency with Professional Data Entry Services
eloiacs eloiacs
 
PDF
lecture12.pdf Introduction to bioinformatics
SergeyTsygankov6
 
PDF
11_L2_Defects_and_Trouble_Shooting_2014[1].pdf
gun3awan88
 
PPT
Camuflaje Tipos Características Militar 2025.ppt
e58650738
 
最新版美国佐治亚大学毕业证(UGA毕业证书)原版定制
Taqyea
 
Presentation by Tariq & Mohammed (1).pptx
AbooddSandoqaa
 
ilide.info-tg-understanding-culture-society-and-politics-pr_127f984d2904c57ec...
jed P
 
Informatics Market Insights AI Workforce.pdf
karizaroxx
 
Indigo_Airlines_Strategy_Presentation.pptx
mukeshpurohit991
 
The Influence off Flexible Work Policies
sales480687
 
Flextronics Employee Safety Data-Project-2.pptx
kilarihemadri
 
Communication_Skills_Class10_Visual.pptx
namanrastogi70555
 
美国毕业证范本中华盛顿大学学位证书CWU学生卡购买
Taqyea
 
最新版意大利米兰大学毕业证(UNIMI毕业证书)原版定制
taqyea
 
Predicting Titanic Survival Presentation
praxyfarhana
 
NVIDIA Triton Inference Server, a game-changing platform for deploying AI mod...
Tamanna36
 
Daily, Weekly, Monthly Report MTC March 2025.pptx
PanjiDewaPamungkas1
 
Reliability Monitoring of Aircrfat commerce
Rizk2
 
Crafting-Research-Recommendations Grade 12.pptx
DaryllWhere
 
Mynd company all details what they are doing a
AniketKadam40952
 
Boost Business Efficiency with Professional Data Entry Services
eloiacs eloiacs
 
lecture12.pdf Introduction to bioinformatics
SergeyTsygankov6
 
11_L2_Defects_and_Trouble_Shooting_2014[1].pdf
gun3awan88
 
Camuflaje Tipos Características Militar 2025.ppt
e58650738
 
Ad

Introduction to Python - Algorithm Compiler

  • 1. Little Intro ❏ Raza Ul Mustafa, PhD - Computer Engineering ❏ Research areas: NLP, Video, Quality of Experience, Quality of Service, Machine & Deep Learning ❏ Publications - 20 + → Languages used in my papers: Python :) ❏ Main Courses of Interests: Programming ❏ Python, Web-programming, C/C++, Linux ❏ Worked & Working on Research Projects: 3+
  • 2. Books - The primary text for this course is a freely available online textbook called Think Python: How to Think like a Computer Scientist. - We will be using the interactive version of the text that is available through Runestone Academy at https://runestone.academy.
  • 3. Outline of course - Main topics 1. Variables & Operations 2. Strings & Numbers 3. Functions 4. Conditions / If/Elif/Else 5. Iterations – Very Important 6. Lists, Dictionaries, Tuples – Important in Python 7. Recursion, Sorting 8. OOP – Very important in all languages
  • 5. Software to Install - Anaconda & Spyder Windows Installation - https://docs.anaconda.com/free/anaconda/install/win dows/ Mac Installation - https://docs.anaconda.com/free/anaconda/install/mac -os/ Linux - https://docs.anaconda.com/free/anaconda/install/linu x/
  • 7. The way of program ❏ The single most important skill for a computer scientist is problem solving ❏ A program is a sequence of instructions that specifies how to perform a computation.
  • 8. Algorithms - If problem solving is a central part of computer science, then the solutions that you create through the problem solving process are also important. - In computer science, we refer to these solutions as algorithms. - An algorithm is a step by step list of instructions that if followed exactly will solve the problem under consideration. Our goal in computer science is to take a problem and develop an algorithm that can serve as a general solution
  • 9. The python programming languages Python is an example of a high-level language; other high-level languages you might have heard of are C++, PHP, and Java. High Level Languages: They are very easy to understand, i.e., resembles natural language or mathematical notation and is designed to reflect the requirements of a problem Low Level Languages: They are also called machine-level languages. 0101
  • 10. Advantages of high level languages - First, it is much easier to program in a high-level language. - Programs written in a high-level language take less time to write, they are shorter and easier to read, and they are more likely to be correct. - High-level languages are portable, meaning that they can run on different kinds of computers with few or no modifications.
  • 11. Then who process the codes? Two kinds of programs process high-level languages into low-level languages: interpreters and compilers. - Interpreters: An interpreter reads a high-level program and executes it, meaning that it does what the program says. - Compiler: A compiler reads the program and translates it completely before the program starts running. - In this case, the high-level program is called the source code, and the translated program is called the object code or the executable.
  • 12. Python Interpreter (1/2) There are two ways to use the Python interpreter: shell mode and program mode. In shell mode, you type Python expressions into the Python shell, and the interpreter immediately shows the result. The example below shows the Python shell at work.
  • 13. Python Interpreter (2/2) Program mode: Alternatively, you can write an entire program by placing lines of Python instructions in a file and then use the interpreter to execute the contents of the file as a whole. Such a file is often referred to as source code.
  • 14. Saving and extension By convention, files that contain Python programs have names that end with .py. Following this convention will help your operating system and other programs identify a file as containing python code.
  • 15. What is debugging Programming is a complex process. Since it is done by human beings, errors may often occur. Programming errors are called bugs and the process of tracking them down and correcting them is called debugging. ● syntax errors, ● runtime errors, ● semantic errors.
  • 16. Syntax errors Python can only execute a program if the program is syntactically correct; otherwise, the process fails and returns an error message. Syntax refers to the structure of a program and the rules about that structure Example – Next slide
  • 18. Runtime errors ❏ The second type of error is a runtime error, so called because the error does not appear until you run the program. ❏ These errors are also called exceptions because they usually indicate that something exceptional (and bad) has happened.
  • 20. Semantic errors - The third type of error is the semantic error. - If there is a semantic error in your program, it will run successfully in the sense that the computer will not generate any error messages. - However, your program will not do the right thing. It will do something else. Specifically, it will do what you told it to do.
  • 22. Experimental debugging One of the most important skills you will acquire is debugging. Although it can be frustrating, debugging is one of the most intellectually rich, challenging, and interesting parts of programming. Advice: Visualize
  • 23. Comments in python A comment in a computer program is text that is intended only for the human reader - it is completely ignored by the interpreter. In Python, the # token starts a comment. The rest of the line is ignored. Here is a new version of Hello, World!.
  • 24. Chapter python notebook: All material available on Canvas