0% found this document useful (0 votes)
24 views

Introduction To Python

This document provides an introduction to Python including why it is a popular language, its growing demand and average salaries. It covers Python versions 2 and 3, basics of the Python interpreter, data types, operators, setting up Python and a certificate masterclass in Python fundamentals with hands-on learning.

Uploaded by

magas32862
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Introduction To Python

This document provides an introduction to Python including why it is a popular language, its growing demand and average salaries. It covers Python versions 2 and 3, basics of the Python interpreter, data types, operators, setting up Python and a certificate masterclass in Python fundamentals with hands-on learning.

Uploaded by

magas32862
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Introduction

to
Python

Readable. Simple. Dynamic. Fast.


Powerful. In-demand.

Spotle.ai Study Material


Spotle.ai/Learn
Instructors

Mousum Dutta
Chief Data Scientist, Spotle.ai
IIT Kharagpur

Spotle.ai Study Material


Spotle.ai/Learn
The demand for Python is growing….

Python has
been the
fastest growing
Data Analysis
language,
globally, over
the last few
Machine years, fuelled
Learning
mostly by its
usage in AI and
Spotle.ai Study Material
Spotle.ai/Learn
Data Science
Source: stackoverflow.com
The demand for Python is growing….

Data Analysis
The average
salary of a
Python
Machine developer in
Learning
India is
4.8 lacs per
annum
Spotle.ai Study Material
Spotle.ai/Learn Source: stackoverflow.com
The case for Python
Python Use Cases and Libraries
Web Development ✓ High Usability

• Core Python Packages: Flask, Django ✓ Flexibility – Python allows


easy cross-app integration
Data Science and also inter-operability
with other programming
• Core Python Packages: Pandas, Matplotlib, StatsModels languages

Text Processing ✓ Readable and simple –


Easier to learn, code and
Core Python Packages: NLTK, TextBlob, Spacy debug

Artificial Intelligence ✓ Large standardised library


simplifying complex tasks
• Core Python Packages: SciKit – Learn, Tensorflow, Keras
✓ Interactive mode with the
Scientific and Numeric Computing integrated, easy to use
development environment
• Core Python Packages: NumPy
Jupyter
Used By:
Spotle.ai Study Material
Spotle.ai/Learn
Python 2 vs Python 3

Python 2 Python 3

Legacy Way Ahead


Though used in 63% of software projects till Uptick in adoption. New libraries are being for
2017-18, its adoption is declining. As of 2019, the Python3
latest version of Python 2, Python 2.7 is officially
retired

ASCII UNICODE
Strings are stored as ASCII by default Strings are stored as UNICODE by default

3/2 = 2 3/2 = 1.5


In Python 2, 3/2 is integer division or floor division. In Python 3, 3/2 returns the expected 1.5. So Print
So Print 3/2 will print 1 (3/2) will print1.5

Print is a Statement Print is a Function


Print “Welcome to Spotle.ai” Print (“Welcome to Spotle.ai”)

Spotle.ai Study Material


6
Spotle.ai/Learn
Python Basics

Spotle.ai Study Material


Spotle.ai/Learn
Compiler vs Python Interpreter
Basis Compiler Interpreter
Input It takes an entire program at a It takes a single line of code or
time instruction at a time

Output It generates intermediate object It does not produce any intermediate


code object code

Working The compilation is done before Compilation and execution take


mechanism execution place simultaneously

Speed Comparatively faster Slower

Memory Memory requirement is more due It requires less memory as it does


to the creation of object code not create intermediate object code

Errors Display all errors after Displays error of each line one by
compilation, all at the same time one

Error detection Difficult Easier comparatively

https://techdifferences.com/difference-between-compiler-and-interpreter.html

Spotle.ai Study Material


8
Spotle.ai/Learn
In Python, indentation is not just for
making it look pretty
In Python, indentation has well defined meaning. Indentation is used to
define block of codes. See the below example.

If (1==1) If (1==1)
print (“All is well”) print (“All is well”)
Else Else
print (“End of the world”) print (“End of the world”)
print (“Bye Bye”) print (“Bye Bye”)

This will print This will print


All is well All is well
Bye Bye But will not print Bye Bye

The above piece of code will The above piece of code will
consider print (“Bye Bye”) outside consider print (“Bye Bye”) under
if-else else condition

Spotle.ai Study Material


9
Spotle.ai/Learn
In Python, everything is an object
Python is an object oriented language where everything is an object. Unlike
Ruby, python objects are not necessarily sub-classable or have methods.
They are objects in the sense they can be passed in functions or assigned
to variables.

class Myself
def self_love(self):
Print(“I am awesome”)

Me = Myself()
Me.self_love()

Here Myself is a class, the function self_love is called a method of Myself


and Me is an object of type Myself.

Spotle.ai Study Material


10
Spotle.ai/Learn
Data Types and Operators in Python
Python supports 5 standard data types.

Numbers
String
List
Tuple
Dictionary

Python supports a wide variety of operators.

✓ Arithmetic Operators
✓ Comparison (Relational) Operators
✓ Assignment Operators
✓ Logical Operators
✓ Bitwise Operators
✓ Membership Operators
✓ Identity Operators

Spotle.ai Study Material


11
Spotle.ai/Learn
Setting up Python
This video will help you setup Python Environment in your computer and write your
first Python program.

Spotle.ai Study Material


12
Spotle.ai/Learn
Certificate Masterclass In
Python Fundamentals
with Hands-ons

Spotle.ai Study Material


Spotle.ai/Learn
Certificate Masterclass in Python – What
will you learn?
✓ Go from an absolute beginner to a confident programmer level with complete
understanding of Python basics

✓ Master the latest version of Python, Python 3 in 6 weeks

✓ Get adequate hands-on exercises to practise all your Python concepts.

✓ Cover fundamentals and basic libraries including Classes and objects,


Numbers, Strings, Basic Operators

✓ Practise Python through comprehensive quizzes with detailed notes to help you
understand solutions

✓ Build your foundation for more advanced programs including Data Science,
Text Processing, Machine Learning and Deep Learning using Python

✓ Understand career paths in Python and how to prepare for career opportunities

Spotle.ai Study Material


14
Spotle.ai/Learn
Learn at your own pace with integrated
instructor support
Live Classes With
20 Interactive Videos with
illustrative examples 4 Instructors to learn
concepts first-hand

20 Quizzes to test your


learning on the go 20 Practice sessions and
real-life projects

7 Hours Of Lecture
24/7 Access to chat and
career support

Learn Python In The Most Intense Course Ever: https://spotle.ai/learn/python

Spotle.ai Study Material


15
Spotle.ai/Learn
Your Take - aways
✓ Certificate Of Completion.

✓ Integrated live projects and performance based internship.

✓ Membership of Spotle AI Alumni club with priority


access to courses, events and mentoring.

✓ Optimized career path fitment through


AI.

✓ Personalised career
Spotle.ai
Spotle.ai Study
Study Material
Material
guidance and assistance.
Spotle.ai/Learn
Spotle.ai/Learn

Spotle.ai Study Material


16
Spotle.ai/Learn
Sign up for the Masterclass: https://spotle.ai/learn/python

You might also like