Week1 Programming Fundamentals Lecture 1
Week1 Programming Fundamentals Lecture 1
3
RECIPE OF MAKING A PROGRAM
4
TRANSLATORS
There are two kinds of translators which are known as Interpreter and Compilers. These
translators translate our program which is written in C-Language into Machine language.
Interpreters translates the program line by line meaning it reads one line of program and
translates it, then it reads second line, translate it and so on. The benefit of it is that we get
the errors as we go along and it is very easy to correct the errors. The drawback of the
interpreter is that the program executes slowly .
The Compiler read the whole program and translates it into machine language completely.
The difference between interpreter and compiler is that compiler will stop translating if it finds
an error and there will be no executable code generated whereas Interpreter will execute all
the lines before error and will stop at the line which contains the error. So Compiler needs
syntactically correct program to produce an executable code.
5
DEBUGGER
Another important tool is Debugger. Every programmer should be familiar with it.
Debugger is used to debug the program i.e. to correct the logical errors. Using debugger
we can control our program while it is running. We can stop the execution of our program
at some point and can check the values in different variables, can change these values etc.
In this way we can trace the logical errors in our program and can see whether our
program is producing the correct results.
6
COURSE BOOKS & MATERIALS
10/8/2018 7
PROGRAMMING LANGUAGES
10/8/2018 8
PROGRAMMING LANGUAGES
10/8/2018 9
WHY PYTHON?
Python works on different platforms (Windows, Mac, Linux, Raspberry Pi, etc).
Python has a simple syntax similar to the English language.
Python has syntax that allows developers to write programs with fewer lines than some
other programming languages.
Python runs on an interpreter system, meaning that code can be executed as soon as it is
written. This means that prototyping can be very quick.
Python can be treated in a procedural way, an object-orientated way or a functional way.
Python relies on indentation, using whitespace, to define scope; such as the scope of loops,
functions and classes. Other programming languages often use curly-brackets for this
purpose.
10/8/2018 10
HISTORY OF PYTHON
10/8/2018 11
WHAT CAN PYTHON DO?
10/8/2018 12
PROGRAMMING LANGUAGES & TRENDS (2018)
10/8/2018 13
WHAT COMES UNDER FUNDAMENTALS?
Types of
File I/O Concept
filing
1D and
Arrays Concepts
2D arrays
Copy Right - Asst. Prof. Syed Faisal Ali 10/8/2018 15
PYTHON ADVANTAGES & DISADVANTAGE
17
INTRODUCTION TO PYTHON PROGRAMMING
10/8/2018 18
RESERVED WORDS IN PYTHON
and assert break class continue
if import in is lambda
try while
return
10/8/2018 19
PYTHON INSTALLATION
Anaconda Continuum
framework https://www.anaconda.com/download/
Python interpreter
Pycharm IDE
https://www.python.org/downloads/
10/8/2018 20
END OF LECTURE – WEEK 01
10/8/2018 21