You are on page 1of 8

AAKKAM

SESSION 1
BASIC OF PYTHON AND INSTALLATION

TODAY’S QUOTES

I CLOSE THE DOOR TO THE PAST, OPEN THE DOOR TO


THE FUTURE, TAKE A DEEP BREATH, STEP ON THROUGH
AND START A NEW CHAPTER IN YOUR LIFE

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

• Python can be used in multiple programming styles, including


1. Object-Oriented
2. Functional programming
3. Procedural programming
4. Imperative Styles

2
AAKKAM

 It also supports automatic memory management and has a large


standard library and innumerous set of third party libraries.
 Python is free and open-source software.
 Open-source software is a kind of computer software in which the
source code of the software is made public

Python Overview

• Python is a high-level general-purpose programming language.


• Key features:
1. Code written is automatically compiled to byte code and executed
2. Used as a scripting language, for web applications
3. Extending Python with C or C++ can help in the performance of
intensive tasks where speed of execution is key criterion
4. Supports many features such as nested code blocks, functions,
classes, modules and packages

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

 VISUAL STUDIO CODE

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

Standard Data Types

• The data stored in the memory can be many types.


• Python has six basic data types:
1. Numeric
2. String
3. List
4. Tuple
5. Dictionary
6. Boolean

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.

Examples with output


>>>num1=2
>>>num2=2.5 #real number
>>>num1

7
AAKKAM

2
>>>num2
2.5

You might also like