Lecture - 5
Lecture - 5
• Programmer
• Person who writes a program
• Do the programming
• User vs Programmer.
• User see the computer as a set of tools e.g using application software's
• Programmer learns the computer ways and language
Programming Languages
• A programming language is a vocabulary and set of grammatical
rules for instructing a computer or computing device to perform
specific tasks .
• Interpreter
• Assembler
Translation Hierarchy
Flowcharts in programming
•Aflowchart is a type of diagram that represents a
workflow or process
• A flowchart can also be defined as a diagrammatic representation of an algorithm
• A step-by-step approach to solving a task.
• The flowchart shows the steps as boxes, and their order by connecting the boxes with arrows.
Pseudo Code
• A pseudocode is a plain language description of the steps in an algorithm.
• It is intended for human reading rather than machine reading.
• In other words, it is a plain English version of the detailed steps of a computer program that can
be read by non-programmers and used to map code.
A Simple Example
Let's say a bank customer wants to use an ATM to withdraw $100 cash from her account. You need to program for the
ATM to check the customer's balance and determine if there is enough money in the account. The pseudocode would
look something like this:
What is Python?
• Python is a general purpose interpreted, interactive, object-
oriented high-level programming language.
• Data Science
• Machine Learning
• Artificial Intelligence
• Signal and Image Processing
• Bio informatics
• Web Development
• Network Programming
• Game Development
• Databases
Python Versions
• Today, two versions of python are available
• Python 2.x
• Python 3.x
• In some cases, program written for Python 2 may not work on the
systems having Python 3
IDEs for Python
• IDLE
• PyCharm
• Spyder
• Thony
• Jupyter Notebook
• Visual Studio
Talking to Python
Anaconda
• A free and open-source distribution of the Python
programming language.
Input
Processing
Entity
Output
Python Elements
• Vocabulary / Words
A=5 A 5 50
B = 10
B 10
A = 50
Variable Rule
• Thumb Rules for variables
• It can be any name except the reserved keywords of language.
• Must consists of letters, numbers and underscores.
• Must starts with the letter or underscore.
Variable Assignment
Executing Assignment Statement
Enter
Looks like nothing
happened
Enter
Display the value
of A
Print Statement
• Python provides a build in function print(), which allows the program to
the display the text on the screen.
Syntax
print(‘Hello word’)
print(Variable name)
User Input
• Python provides a build in function input(), which allows the program to
get the input at the run time.
Syntax
• Why comment??
Print(A) Function
Data Types
Data Types