SlideShare a Scribd company logo
1 of 24
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/wind
ows/
Mac Installation -
https://docs.anaconda.com/free/anaconda/install/mac-
os/
Linux -
https://docs.anaconda.com/free/anaconda/install/linux
/
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: 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

More Related Content

Similar to Python Intro Slides for Students CSC-148 Chapter 1

An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()Blue Elephant Consulting
 
Introduction to Python Programming Basics
Introduction  to  Python  Programming BasicsIntroduction  to  Python  Programming Basics
Introduction to Python Programming BasicsDhana malar
 
notes on Programming fundamentals
notes on Programming fundamentals notes on Programming fundamentals
notes on Programming fundamentals ArghodeepPaul
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonRanjith kumar
 
LKGtoPG - Basics of C Language
LKGtoPG - Basics of  C LanguageLKGtoPG - Basics of  C Language
LKGtoPG - Basics of C Languagelkgtopg jobs
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfVaibhavKumarSinghkal
 
Specification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaSpecification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaKim Moore
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own languageAndrea Tino
 
Contents Pre-requisites Approximate .docx
   Contents Pre-requisites  Approximate .docx   Contents Pre-requisites  Approximate .docx
Contents Pre-requisites Approximate .docxShiraPrater50
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptxBharathYusha1
 
Algorithm and flowchart(1)
Algorithm and flowchart(1)Algorithm and flowchart(1)
Algorithm and flowchart(1)Suneel Dogra
 
Top Programming Languages of 2020
Top Programming Languages of 2020Top Programming Languages of 2020
Top Programming Languages of 2020Ikbal Ahmed
 

Similar to Python Intro Slides for Students CSC-148 Chapter 1 (20)

Ic lecture8
Ic lecture8 Ic lecture8
Ic lecture8
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
 
An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()An Introduction To Python - Python, Print()
An Introduction To Python - Python, Print()
 
Research paper on python by Rj
Research paper on python by RjResearch paper on python by Rj
Research paper on python by Rj
 
Introduction to Python Programming Basics
Introduction  to  Python  Programming BasicsIntroduction  to  Python  Programming Basics
Introduction to Python Programming Basics
 
python-handbook.pdf
python-handbook.pdfpython-handbook.pdf
python-handbook.pdf
 
notes on Programming fundamentals
notes on Programming fundamentals notes on Programming fundamentals
notes on Programming fundamentals
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
LKGtoPG - Basics of C Language
LKGtoPG - Basics of  C LanguageLKGtoPG - Basics of  C Language
LKGtoPG - Basics of C Language
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
 
Specification Of The Programming Language Of Java
Specification Of The Programming Language Of JavaSpecification Of The Programming Language Of Java
Specification Of The Programming Language Of Java
 
Creating a compiler for your own language
Creating a compiler for your own languageCreating a compiler for your own language
Creating a compiler for your own language
 
Contents Pre-requisites Approximate .docx
   Contents Pre-requisites  Approximate .docx   Contents Pre-requisites  Approximate .docx
Contents Pre-requisites Approximate .docx
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptx
 
Algorithm and flowchart(1)
Algorithm and flowchart(1)Algorithm and flowchart(1)
Algorithm and flowchart(1)
 
Top Programming Languages of 2020
Top Programming Languages of 2020Top Programming Languages of 2020
Top Programming Languages of 2020
 
Unit 1
Unit 1Unit 1
Unit 1
 
JAVA
JAVAJAVA
JAVA
 
Presentation-1.pptx
Presentation-1.pptxPresentation-1.pptx
Presentation-1.pptx
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 

Recently uploaded

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 

Recently uploaded (20)

Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 

Python Intro Slides for Students CSC-148 Chapter 1

  • 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/wind ows/ Mac Installation - https://docs.anaconda.com/free/anaconda/install/mac- os/ Linux - https://docs.anaconda.com/free/anaconda/install/linux /
  • 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: 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