Session- 1 (Python Introduction)
Presented By : Amarjeet Singh
Corporate Trainer
What will be covered in this Session?
Language & Programming Python Keywords
Python Introduction Literals in Python
Why to learn Python Operators in Python
Uses of Python String Functions
Python Installation
Variable in Python
Data Types in Python
Difference between Language and Programming
Exchanging Ideas
Language – Hindi/English etc.
Instructions
Computer
Result
Programming – C, C++,Python & java
About Python Programming
Python is a general-purpose interpreted, interactive, object-
oriented, and high-level programming language.
It uses English keywords frequently where as other languages use
punctuation
It was created by Guido van Rossum during 1985- 1990.
Like Perl, Python source code is also available under the GNU
General Public License (GPL).
Why to Learn Python?
Python is Interpreted
Python is processed at runtime by the interpreter. You do not need to compile your program
before executing it. This is similar to PERL and PHP.
Python is Interactive
You can actually sit at a Python prompt and interact with the interpreter directly to write your
programs.
Python is Object-Oriented
Python supports Object-Oriented style or technique of programming that encapsulates code
within objects.
Uses of Python
Python is a popular programming language in many fields.
It is used for:
Web Development (Server-side)
Software Development
Mathematics
Data Analytics
Data Science
Python Installation
Step-1 Go to www.python.org
Step-2 Go to Downloads
Step-3 Click on Download Python 3.8.5
Step-4 Now Install it
Click on link https://www.python.org/downloads/
Python IDEs
https://www.jetbrains.com/pycharm/download/#section=windows
https://www.anaconda.com/products/individual
Variables in Python
Data/values can be stored in temporary storage spaces called variables.
What is
Variable
? name = “Amit”
age = 31
per = 89.60
Explain Variables in Python
student “Mike”
student “Shelly”
student “John”
Explain Variables in Python
Final Result
student “John”
Data Types in Python
Data type defines which type of data we want to store in variable.
Data-Types
Int Float String Boolean Complex
20 20.52 “Amit”
True 5+3j
30452 3045.542 “Aman”
False Real + Imaginary
-21 -21.546 “Lalit”
Implementation Data Types in Python
User Choice input - int
User Choice input - float
User Choice input - str
Keywords in Python
Keywords are special reserved words in any programming language.
Literals in Python
Python Literals can be defined as data that is given in a variable.
String Literal “Mike”, “52634”
int Literal 24, 56,365
float Literal 23.635, 452.56
Boolean Literal True, False
Operators in Python
Data type defines which type of data we want to store in variable.
Operators
Arithmetic Comparison Logical Assignment Bitwise Membership Identify
+ - == != and = &
in is
/ * <= >= or += -= |
not in Is not
% > < not *= %= ^
Arithmetic Operators (+ , -, *, /, %)
Relational Operators ==, !=, <=, >=, >, <
Logical Operators (and, or, not)
Assignment Operators (=,+=, -=,*= ,%=)
Bitwise Operators (&, |, ^)
Complement(~) 13’s Comp= 00001101 And(&)
0=1 11110010 12=00001100
1=0 +1 13=00001101
11110011 00001100 = 12
Binary Format Or(|)
12 = 00001100 12=00001100
~12 = 11110011 Xor(^) 13=00001101
00 =0 00001101 = 13
2’s Complement 01= 1
Xor(^)
(1’s Complment+1) 10=1
12=00001100
11=0
13=00001101
00000001 = 1
Bitwise Operators (&, |, ^)
String Functions
Upper() Convert characters in capital letter
Lower() Convert characters in small letter
Find() Find particular character & word in string
Split() Separate strings by comma
Replace() Replace any word or character
Count() Count word & letter in the string
String Functions