Professional Documents
Culture Documents
Basic of Python and Installation
Basic of Python and Installation
SESSION 1
BASIC OF PYTHON AND INSTALLATION
TODAY’S QUOTES
1
AAKKAM
Why Python?
High-level,
Interpreted,
Reflective,
Dynamically-typed,
Open-source,
Multi-paradigm &
General purpose programming language
Introduction
Python is a high-level, interpreted, general-purpose, dynamic
programming language.
Python was conceived -1980s
Usage began from December 1989
Widely used programming language
Property: Reusability
2
AAKKAM
Python Overview
Additional Features:
1. Many built-in data types: strings, lists, tuples, dictionaries, etc.
2. It supports many control statements such as if, if-else, if-elif-else,
while, iterative for, etc.
3. It allows for easier programming with the use of functions, classes,
modules and packages.
3
AAKKAM
INSTALLATION
https://www.youtube.com/watch?v=eLDOf6moH7o
XAMPP
https://www.youtube.com/watch?v=5rj7zQ5IJDc
PYTHON
https://www.youtube.com/watch?v=5VhymepIt44
PYTHON (FLASK)
https://www.youtube.com/watch?v=7tOviDL5dO0
4
AAKKAM
Comments
Python allows to add comments in the code
It is a piece of code to others or to oneself in simple language
Every programming language makes use of some special character
for commenting
Python uses the hash character(#) for comments
Comments do not affect the programming part
It will not display any error message for comments
It is good practice to use comments for documentation purpose.
Sample Program
>>> 8 + 9
17 #Output
>>>print “Hello, Python!”
This produces the result:
Hello, Python! #Output
>>> ‘hello’
‘hello’ #Output
5
AAKKAM
Variables
Declaring a variable
Initializing a variable
Declaring a variable
A variable holds a value that may change
The process of writing the variable name is called “Declaring the
variable”
When initializing the variable in python, the interpreter
automatically does the declaration process
The general format of assignment statement is as follows:
Variable = expression
The equal sign is known as the assignment operator
An Expression is any value, text or arithmetic expression.
Example
>>>year = 2016
>>> name = ‘albert’
The two given statements reserve two memory spaces with variable
names year and name.
2016 and albert are stored respectively in the memory space
>>>year
2016
>>>name
‘albert’
6
AAKKAM
Numeric:
It is divided into integers and real numbers
Integers can be positive or negative
The real numbers or fractional numbers are called floating point
numbers.
Floating point numbers contain a decimal and a fractional part.
7
AAKKAM
2
>>>num2
2.5