https://www.poriyaan.in/ https://eee.poriyaan.in/
DATA, EXPRESSIONS, STATEMENTS
PROGRAM Problem Solving and Python Programming
The most important skill for a computer Engineer is problem solving. Problem solving
means the ability to formulate problem, think creatively about solution clearly and accurately.
The process of learning to program is an excellent opportunity to practice Problem solving skills.
“A program is a sequence of instructions that specifies how to perform a computation” .The
computation might be mathematical i e Solving equations, Finding the roots of polynomial,
/
in
symbolic computation such as searching and replacing text in a document.
n.
Basic Instruction in Language
Input: Get data from Keyboard.
aa
Output: Display data on the screen
Math: Perform the mathematical operations.
riy
Conditional Execution: Check condition and execute certain code.
Repetition: Perform some action repeatedly.
o
.p
INTRODUCTION
w
Python
w
ython is a high level programming language like C, C++ designed to be easy to read,
//w
and less time to write. It is an open source and it is an interpreter which directly executes the
program without creating any executable file. Python is portable which means python can run on
s:
different platform with less or no modifications.
tp
Features of Python:
ht
Python is publicly available open source software.
Python is easy to learn.
Python is easy to read.
Python is easy to maintain.
Python provides automatic memory management.
Python is portable.
Python support database and GUI(Graphical User Interface)
, https://www.poriyaan.in/ https://eee.poriyaan.in/
PYTHON INTERPRETER AND INTERACTIVE MODE
Python Interpreter
Python Interpreter translates high level instruction into an immediate form of machine
level language. It executes instructions directly without compiling.
Interpreter
Source Code (or) Source Code
Intermediate
/
in
n.
The Python interpreter is usually installed in C:/Program Files/Python3.6. In windows
operating python can also be found in the start menu. All Programs Python 3.6 Python 3.6
aa
(Shell) and Python IDLE.
Python Interactive mode
riy
Interactive mode is a command line which gives immediate feedback for each statement.
o
Python interactive mode can be start by two methods - Python 3.6 (Shell) and Python
.p
IDLE.
Python 3.6 (Shell), A prompt will appear and it usually have 3 greater than signs (>>>).
w
Each Statements can be enter after this (>>>) symbol. For continuous lines three dots (…)
w
will represent the multiple lines.
//w
Python IDLE (Integrated Development for Learning Environment) which provides a user
friendly console to the python users. Different colors are used to represent different
s:
keywords.
tp
IDLE starts by python version, after a line (>>>) three greater than symbols will be
displayed. The statements will be executed in that line.
ht
Example:
>>> 1+1
2
>>>5+10
15
In Script mode
In script mode, type python program in a file and store the file with .py extension and use
the interpreter to execute the content of the file which is called a script.Working in script
mode is convenient for testing small piece of code because you can type and execute
them immediately, But for more than few line we can use script since we can modify and
execute in future.
Download Binils Android App in Playstore Download Photoplex App
, https://www.poriyaan.in/ https://eee.poriyaan.in/
Debugging
Programming is error –prone, programming errors are called bugs and process of tracking
them is called debugging.
Three kinds of error can occur in a program:
o Syntax Error
o Runtime Error
o Semantic error.
/
in
Syntax error:
Syntax refers to the structure of a program and rules about the structure. Python can only
n.
execute a program if the syntax is correct otherwise the interpreter display an error
aa
message.
Runtime Error:
riy
The error that occurs during the program execution is called run time error.
Semantic Error:
o
.p
The computer will not generate any error message but it will not do the right thing since
the meaning of the program is wrong.
w
Integrated Development Environment (IDE)
w
We can use any text editing software to write a Python script file. We just need to save it
//w
with the .py extension. IDE is a piece of software that provides useful features like code hinting,
syntax highlighting and checking, file explorers etc. to the programmer for application
development.
s:
IDLE is a graphical user interface (GUI) that can be installed along with the Python
tp
programming language.
ht
Example:
Type the following code in any text editor or an IDE and save it as helloWorld.py
print("Hello world!")
To run the script, type python helloWorld.py in the command window and the output as
follows:
Hello world!
DATA, EXPRESSIONS, STATEMENTS
PROGRAM Problem Solving and Python Programming
The most important skill for a computer Engineer is problem solving. Problem solving
means the ability to formulate problem, think creatively about solution clearly and accurately.
The process of learning to program is an excellent opportunity to practice Problem solving skills.
“A program is a sequence of instructions that specifies how to perform a computation” .The
computation might be mathematical i e Solving equations, Finding the roots of polynomial,
/
in
symbolic computation such as searching and replacing text in a document.
n.
Basic Instruction in Language
Input: Get data from Keyboard.
aa
Output: Display data on the screen
Math: Perform the mathematical operations.
riy
Conditional Execution: Check condition and execute certain code.
Repetition: Perform some action repeatedly.
o
.p
INTRODUCTION
w
Python
w
ython is a high level programming language like C, C++ designed to be easy to read,
//w
and less time to write. It is an open source and it is an interpreter which directly executes the
program without creating any executable file. Python is portable which means python can run on
s:
different platform with less or no modifications.
tp
Features of Python:
ht
Python is publicly available open source software.
Python is easy to learn.
Python is easy to read.
Python is easy to maintain.
Python provides automatic memory management.
Python is portable.
Python support database and GUI(Graphical User Interface)
, https://www.poriyaan.in/ https://eee.poriyaan.in/
PYTHON INTERPRETER AND INTERACTIVE MODE
Python Interpreter
Python Interpreter translates high level instruction into an immediate form of machine
level language. It executes instructions directly without compiling.
Interpreter
Source Code (or) Source Code
Intermediate
/
in
n.
The Python interpreter is usually installed in C:/Program Files/Python3.6. In windows
operating python can also be found in the start menu. All Programs Python 3.6 Python 3.6
aa
(Shell) and Python IDLE.
Python Interactive mode
riy
Interactive mode is a command line which gives immediate feedback for each statement.
o
Python interactive mode can be start by two methods - Python 3.6 (Shell) and Python
.p
IDLE.
Python 3.6 (Shell), A prompt will appear and it usually have 3 greater than signs (>>>).
w
Each Statements can be enter after this (>>>) symbol. For continuous lines three dots (…)
w
will represent the multiple lines.
//w
Python IDLE (Integrated Development for Learning Environment) which provides a user
friendly console to the python users. Different colors are used to represent different
s:
keywords.
tp
IDLE starts by python version, after a line (>>>) three greater than symbols will be
displayed. The statements will be executed in that line.
ht
Example:
>>> 1+1
2
>>>5+10
15
In Script mode
In script mode, type python program in a file and store the file with .py extension and use
the interpreter to execute the content of the file which is called a script.Working in script
mode is convenient for testing small piece of code because you can type and execute
them immediately, But for more than few line we can use script since we can modify and
execute in future.
Download Binils Android App in Playstore Download Photoplex App
, https://www.poriyaan.in/ https://eee.poriyaan.in/
Debugging
Programming is error –prone, programming errors are called bugs and process of tracking
them is called debugging.
Three kinds of error can occur in a program:
o Syntax Error
o Runtime Error
o Semantic error.
/
in
Syntax error:
Syntax refers to the structure of a program and rules about the structure. Python can only
n.
execute a program if the syntax is correct otherwise the interpreter display an error
aa
message.
Runtime Error:
riy
The error that occurs during the program execution is called run time error.
Semantic Error:
o
.p
The computer will not generate any error message but it will not do the right thing since
the meaning of the program is wrong.
w
Integrated Development Environment (IDE)
w
We can use any text editing software to write a Python script file. We just need to save it
//w
with the .py extension. IDE is a piece of software that provides useful features like code hinting,
syntax highlighting and checking, file explorers etc. to the programmer for application
development.
s:
IDLE is a graphical user interface (GUI) that can be installed along with the Python
tp
programming language.
ht
Example:
Type the following code in any text editor or an IDE and save it as helloWorld.py
print("Hello world!")
To run the script, type python helloWorld.py in the command window and the output as
follows:
Hello world!