SlideShare a Scribd company logo
1 of 45
Basics of Python
Python is an interpreted, high-level, general-purpose
programming language.
Agenda
• Considerations
• Who uses python ?
• Why Python ?
• Version
• IDEs
• Syntax
• Type / Arithmetic operator / Conditions
• Functions
• Classes
• File Handling
• Web Frameworks
• Python Package Manager (PIP)
Considerations
• Current tutorial is based on python 3.8.3 version on Windows 10 operating system
• PyCharm community edition has been used as Integrated development environment (IDE)
• User can download and install latest python from website https://www.python.org/downloads/
• User can download and install latest PyCharm ide from website https://www.jetbrains.com/pycharm/
Who uses Python?
Some of the world-class Software Companies That use Python
• Google
• Facebook
• Instagram
• Spotify
• Quora
• Netflix
• Dropbox
Why Python?
• Python is an interpreted, high-level, general-purpose programming language.
• Python is a multi-paradigm programming language. Object-oriented programming and structured programming are
fully supported, and many of its features support functional programming and aspect-oriented programming
• Python is meant to be an easily readable language. Its formatting is visually uncluttered, and it often uses English
keywords where other languages use punctuation
• Python uses whitespace indentation, rather than curly brackets or keywords, to delimit blocks
• Aim to help programmers write clear, logical code for small and large-scale projects
Version
• Python 1.0 released in 1994
• Python 2.0 released in 2000
• Python 3.0 released in 2008
• Stable version 3.8.3
• Preview release 3.9.0b3 in June 2020
IDEs (Integrated Development Environment)
Best freeware IDEs
• IDLE (By default comes with Python installer)
• PyCharm Community Edition (Best in freeware category)
• Spyder
• Atom
• Jupyter
• PyDev (third-party Python editor for Eclipse)
Syntax
Correct Indentation:
Syntax
Incorrect Indentation:
Syntax
How to comment code
Type
Strings
Type
Numbers
Type
Conversions
Arithmetic operator
Comparison Operators
Logical Operators
Conditions
If – elif - else
Loop
For Loop
Loop
While loop
List
A list is a collection which is ordered and changeable. In Python lists are written with square
brackets.
List - Functions
List Comprehension
Dictionary
A dictionary is a collection which is unordered, changeable and indexed. In Python
dictionaries are written with curly brackets, and they have keys and values
Dictionary
Tuple
A tuple is a collection which is ordered and unchangeable. In Python tuples are written
with round brackets.
Set
A set is a collection which is unordered and unindexed. In Python sets are written with
curly brackets.
Functions
Functions
Functions
Functions
Function
Class
Class
Class
Class
Import
Try - Except - Finally
The try block lets you test a block of code for errors.
The except block lets you handle the error.
The finally block lets you execute code, regardless of the result of the try- and except blocks.
File Handling
The open() function takes two parameters; filename, and mode.
"r" - Read - Default value. Opens a file for reading, error if the file does not exist
"a" - Append - Opens a file for appending, creates the file if it does not exist
"w" - Write - Opens a file for writing, creates the file if it does not exist
"x" - Create - Creates the specified file, returns an error if the file exists
File Handling
Docstring
Input
Web Frameworks for Web Development
• Django
• Flask
• Pylon
• CherryPy
• Web2py
• TurboGears
Python Package Manager (PIP)
A package contains all the files you need for a module.
Some of the examples:
• pip install django
• pip install behave
• pip install selenium
Resources
• https://www.python.org/
Thank You!
For any queries connect me at jatinkochhar@hotmail.com

More Related Content

What's hot

What's hot (20)

Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python programming
Python  programmingPython  programming
Python programming
 
Python Tutorial for Beginner
Python Tutorial for BeginnerPython Tutorial for Beginner
Python Tutorial for Beginner
 
Python
PythonPython
Python
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
 
Basics of python
Basics of pythonBasics of python
Basics of python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Python
PythonPython
Python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming Python programming | Fundamentals of Python programming
Python programming | Fundamentals of Python programming
 
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | EdurekaPython Course | Python Programming | Python Tutorial | Python Training | Edureka
Python Course | Python Programming | Python Tutorial | Python Training | Edureka
 
Python Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | EdurekaPython Basics | Python Tutorial | Edureka
Python Basics | Python Tutorial | Edureka
 
Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)Python 101: Python for Absolute Beginners (PyTexas 2014)
Python 101: Python for Absolute Beginners (PyTexas 2014)
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Introduction To Python | Edureka
Introduction To Python | EdurekaIntroduction To Python | Edureka
Introduction To Python | Edureka
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 

Similar to Basics of python

Similar to Basics of python (20)

What is python
What is pythonWhat is python
What is python
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
 
Summer Training Project On Python Programming
Summer Training Project On Python ProgrammingSummer Training Project On Python Programming
Summer Training Project On Python Programming
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python Programming
 
Python indroduction
Python indroductionPython indroduction
Python indroduction
 
Python Workshop
Python WorkshopPython Workshop
Python Workshop
 
Session-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptxSession-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptx
 
01 python introduction
01 python introduction 01 python introduction
01 python introduction
 
Python Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & style
 
About python
About pythonAbout python
About python
 
Python Training
Python TrainingPython Training
Python Training
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshop
 
Raspberry using Python Session 1
Raspberry using Python Session 1Raspberry using Python Session 1
Raspberry using Python Session 1
 
Introduction_to_Python.pptx
Introduction_to_Python.pptxIntroduction_to_Python.pptx
Introduction_to_Python.pptx
 
Python basics
Python basicsPython basics
Python basics
 
Python for katana
Python for katanaPython for katana
Python for katana
 
Robot Framework with Python | Edureka
Robot Framework with Python | EdurekaRobot Framework with Python | Edureka
Robot Framework with Python | Edureka
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 
Python Interview Questions For Experienced
Python Interview Questions For ExperiencedPython Interview Questions For Experienced
Python Interview Questions For Experienced
 

More from Jatin Kochhar

More from Jatin Kochhar (17)

GDPR Data Life Cycle
GDPR Data Life CycleGDPR Data Life Cycle
GDPR Data Life Cycle
 
Why We Require GDPR?
Why We Require GDPR?Why We Require GDPR?
Why We Require GDPR?
 
Intent Based Analytics with Google Analytics and Google Tag Manager
Intent Based Analytics with Google Analytics and Google Tag ManagerIntent Based Analytics with Google Analytics and Google Tag Manager
Intent Based Analytics with Google Analytics and Google Tag Manager
 
Mobile Application vs Web Application
Mobile Application vs Web ApplicationMobile Application vs Web Application
Mobile Application vs Web Application
 
Integration of Google Tag Manager and Google Analytics
Integration of Google Tag Manager and Google AnalyticsIntegration of Google Tag Manager and Google Analytics
Integration of Google Tag Manager and Google Analytics
 
Search Engine Marketing
Search Engine MarketingSearch Engine Marketing
Search Engine Marketing
 
Search Engine Optimization - Optimize Organic Search
Search Engine Optimization - Optimize Organic SearchSearch Engine Optimization - Optimize Organic Search
Search Engine Optimization - Optimize Organic Search
 
Analytic Tool Hotjar - Capability
Analytic Tool Hotjar - CapabilityAnalytic Tool Hotjar - Capability
Analytic Tool Hotjar - Capability
 
Landing Page Optimization
Landing Page OptimizationLanding Page Optimization
Landing Page Optimization
 
Accessibility for Content Developer, Designer, Code Developer and Tester
Accessibility for Content Developer, Designer, Code Developer and TesterAccessibility for Content Developer, Designer, Code Developer and Tester
Accessibility for Content Developer, Designer, Code Developer and Tester
 
Accessibility Testing Approach
Accessibility Testing ApproachAccessibility Testing Approach
Accessibility Testing Approach
 
What is Accessibility
What is AccessibilityWhat is Accessibility
What is Accessibility
 
GDPR Data Lifecycle
GDPR Data LifecycleGDPR Data Lifecycle
GDPR Data Lifecycle
 
Global Data Privacy Regulation
Global Data Privacy RegulationGlobal Data Privacy Regulation
Global Data Privacy Regulation
 
Software Test Estimation
Software Test EstimationSoftware Test Estimation
Software Test Estimation
 
Conformance Checklist for Product Owner
Conformance Checklist for Product OwnerConformance Checklist for Product Owner
Conformance Checklist for Product Owner
 
Software Testing Metrics
Software Testing MetricsSoftware Testing Metrics
Software Testing Metrics
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Basics of python

  • 1. Basics of Python Python is an interpreted, high-level, general-purpose programming language.
  • 2. Agenda • Considerations • Who uses python ? • Why Python ? • Version • IDEs • Syntax • Type / Arithmetic operator / Conditions • Functions • Classes • File Handling • Web Frameworks • Python Package Manager (PIP)
  • 3. Considerations • Current tutorial is based on python 3.8.3 version on Windows 10 operating system • PyCharm community edition has been used as Integrated development environment (IDE) • User can download and install latest python from website https://www.python.org/downloads/ • User can download and install latest PyCharm ide from website https://www.jetbrains.com/pycharm/
  • 4. Who uses Python? Some of the world-class Software Companies That use Python • Google • Facebook • Instagram • Spotify • Quora • Netflix • Dropbox
  • 5. Why Python? • Python is an interpreted, high-level, general-purpose programming language. • Python is a multi-paradigm programming language. Object-oriented programming and structured programming are fully supported, and many of its features support functional programming and aspect-oriented programming • Python is meant to be an easily readable language. Its formatting is visually uncluttered, and it often uses English keywords where other languages use punctuation • Python uses whitespace indentation, rather than curly brackets or keywords, to delimit blocks • Aim to help programmers write clear, logical code for small and large-scale projects
  • 6. Version • Python 1.0 released in 1994 • Python 2.0 released in 2000 • Python 3.0 released in 2008 • Stable version 3.8.3 • Preview release 3.9.0b3 in June 2020
  • 7. IDEs (Integrated Development Environment) Best freeware IDEs • IDLE (By default comes with Python installer) • PyCharm Community Edition (Best in freeware category) • Spyder • Atom • Jupyter • PyDev (third-party Python editor for Eclipse)
  • 20. List A list is a collection which is ordered and changeable. In Python lists are written with square brackets.
  • 23. Dictionary A dictionary is a collection which is unordered, changeable and indexed. In Python dictionaries are written with curly brackets, and they have keys and values
  • 25. Tuple A tuple is a collection which is ordered and unchangeable. In Python tuples are written with round brackets.
  • 26. Set A set is a collection which is unordered and unindexed. In Python sets are written with curly brackets.
  • 32. Class
  • 33. Class
  • 34. Class
  • 35. Class
  • 37. Try - Except - Finally The try block lets you test a block of code for errors. The except block lets you handle the error. The finally block lets you execute code, regardless of the result of the try- and except blocks.
  • 38. File Handling The open() function takes two parameters; filename, and mode. "r" - Read - Default value. Opens a file for reading, error if the file does not exist "a" - Append - Opens a file for appending, creates the file if it does not exist "w" - Write - Opens a file for writing, creates the file if it does not exist "x" - Create - Creates the specified file, returns an error if the file exists
  • 41. Input
  • 42. Web Frameworks for Web Development • Django • Flask • Pylon • CherryPy • Web2py • TurboGears
  • 43. Python Package Manager (PIP) A package contains all the files you need for a module. Some of the examples: • pip install django • pip install behave • pip install selenium
  • 45. Thank You! For any queries connect me at jatinkochhar@hotmail.com