SlideShare a Scribd company logo
1 of 42
IntroducingIntroducing
2
Agenda
What is Python?
Features
Characteristics
Programming in Python
Modules and Tools
Q&A
3
What is Python?
Created by Guido Van Rossum as a successor
to the ABC programming language
Conceived in 1980, started development in
1989, v1.0 out in 1994
Name is derived from Monty Python’s Flying
Circus
4
Python in the real world
Uses millions of lines of Python code for ad
management to build automation
Employs the creator of Python himself
5
Python in the real world
Industrial Light & Magic
Uses Python to automate visual effects
6
Python in the real world
Uses Python for their desktop application
Python automates the synchronization and file
sending over the internet to Dropbox’s cloud
storage servers
7
Python in the real world
Django web framework is built using Python
Notable users of Django are some of the
biggest websites today
8
Python in the real world
Blender, a 3D Imaging program uses Python
as its main scripting language
9
Python in the real world
Minecraft uses Python as its scripting language
to automate building
10
Python in the real world
Google
Industrial Light and Magic (Star Wars)
Django web framework (used in Pinterest, Instagram, Mozilla)
Dropbox
Reddit
LibreOffice
Games (Battlefield, EVE Online, Civilization IV, Minecraft, etc.)
...and many more!
11
Why Python?
Simple, like speaking English
It’s FOSS! Lots of resources available
High level programming language
Object-oriented, but not enforced
Portable, works on a lot of different systems
Can be embedded in programs for scripting capabilities
Extensive libraries available
Extensible
12
Getting Started
Go to https://www.python.org and download
the latest version of Python for your OS
13
Installing on Windows
Add Python 3.5 to PATH
14
Running Python
Run the Python interpreter by typing “python”
in the command line
15
Basic Characteristics
Organized syntax
Indentation is strictly enforced
Encourages proper programming practices
Dynamic variable typing
Variables are simply names that refer to objects
No defined data type during compile time
16
Simple and Readable
Python programs look like pseudo-code
compared to other prominent languages
Sample code – helloworld.py
17
Indentation
Proper Indentation is enforced to identify
sections within your program (functions,
procedures, classes)
Sample code – guessgame.py
18
Indentation
19
Built-in Data Types
Boolean
Numbers (integers, real, complex)
Strings
Sequence Types
Tuples
Lists (resize-able arrays)
Range
Set Types
Set, FrozenSet
Dictionary
20
Data Types – Tuples
class tuple([iterable])
Immutable sequence of data – once assigned,
elements within cannot be changed
Using a pair of parentheses to denote the empty tuple:
()
Using a trailing comma for a singleton tuple: a, or (a,)
Separating items with commas: a, b, c or (a, b, c)
Using the tuple() built-in: tuple() or tuple(iterable)
21
Data Types – Tuples
Sample code:
Output:
22
Data Types – Tuples
Python Expression Result Description
Len((1,2,3)) 3 Length
(1,2,3) + (4,5,6) (1,2,3,4,5,6) Concatenation
('Hi!',) * 4 ('Hi!', 'Hi!', 'Hi!', 'Hi!') Repetition
3 in (1, 2, 3) True Membership
for x in (1, 2, 3):
print(x)
1 2 3 Iteration
Basic tuple operations
23
Data Types – List
class list([iterable])
Mutable sequence of data – once assigned,
elements within cannot be changed
Using a pair of square brackets to denote the empty
list: []
Using square brackets, separating items with commas:
[a], [a, b, c]
Using a list comprehension: [x for x in iterable]
Using the type constructor: list() or list(iterable)
24
Data Types – List
Sample code:
Output:
25
Data Types – List
Basic list operations
Python Expression Result Description
Len([1,2,3]) 3 Length
[1,2,3] + [4,5,6] [1,2,3,4,5,6] Concatenation
['Hi!',] * 4 ['Hi!', 'Hi!', 'Hi!', 'Hi!'] Repetition
3 in [1, 2, 3] True Membership
for x in [1, 2, 3]:
print(x)
1 2 3 Iteration
26
Built-in Functions
Some built-in functions that work with tuples
and lists
min() - Return the smallest item
max() - Return the largest item
len() - Return the length of the object
sorted() - Sorts an iterable object
27
When to use Tuple and List
A tuple’s contents cannot be changed
individually once assigned
Each element of a list can be dynamically
assigned
28
Data Types – Range
class range(stop)
class range(start, stop[, step])
Represents an immutable sequence of numbers and is commonly
used for looping a specific number of times
start - The value of the start parameter (or 0 if the parameter was not
supplied)
stop - The value of the stop parameter
step - The value of the step parameter (or 1 if the parameter was not
supplied)
It only stores the start, stop and step values, calculating
individual items and subranges as needed
29
Data Types – Range
Sample code and output:
30
Data Types – Set
class set([iterable])
class frozenset([iterable])
An unordered collection of distinct hashable
(non-dynamic) objects
Common use includes membership testing,
removing duplicates from a sequence,
mathematical operations (union, intersection,
difference, symmetric difference)
31
Data Types – Set
Sample code and output:
32
Data Types – Dictionary
class dict(**kwarg)
class dict(mapping, **kwarg)
class dict(iterable, **kwarg)
Immutable sequence of data – once assigned,
elements within cannot be changed
Can be created by placing a comma-separated list of
key: value pairs within braces
Example: {'apple': 10, 'orange': 12} or {10: 'apple', 12:
'orange'}, or by the dict() constructor
33
Data Types – Dictionary
Sample code:
Output:
34
Defining Functions
You can define functions to provide the required functionality. Here are
simple rules to define a function in Python.
Function blocks begin with the keyword def followed by the function name and
parentheses ( ( ) ).
Any input parameters or arguments should be placed within these parentheses.
You can also define parameters inside these parentheses.
The first statement of a function can be an optional statement - the
documentation string of the function or docstring.
The code block within every function starts with a colon (:) and is indented.
The statement return [expression] exits a function. A return statement with no
arguments is the same as return None.
35
Defining Functions
Sample Code and Output:
36
Object-oriented Programming
Object: A unique instance of a data structure that's defined by its class. An
object comprises both data members (class variables and instance
variables) and methods.
Class: A user-defined prototype for an object that defines a set of attributes
that characterize any object of the class. The attributes are data members
(class variables and instance variables) and methods, accessed via dot
notation.
Class variable: A variable that is shared by all instances of a class. Class
variables are defined within a class but outside any of the class's methods.
Class variables are not used as frequently as instance variables are.
Data member: A class variable or instance variable that holds data
associated with a class and its objects.
37
Object-oriented Programming
Instance variable: A variable that is defined inside a method and
belongs only to the current instance of a class.
Inheritance: The transfer of the characteristics of a class to other
classes that are derived from it.
Instance: An individual object of a certain class. An object obj that
belongs to a class Circle, for example, is an instance of the class
Circle.
Instantiation: The creation of an instance of a class.
Method : A special kind of function that is defined in a class
definition.
38
Object-oriented Programming
In this example, we can see a basic
demonstration of using Classes and
Object-Oriented programming
Class → Employee
Class variable → empCount
Data member → name, salary
Instance → emp1 and emp2
Inhertiance → emp1 and emp2
inherits the properties of the class
Employee
Method → displayCount(),
displayEmployee()
39
Commonly Used Standard
Modules
time – provides objects and functions for working with Time
calendar - provides objects and functions for working with Dates
os, shutil – contains functions that allow Python to interact with the operating
system and the shell
sys – common utility scripts needed to process command line arguments
re – regular expression tools for advanced string processing
math – gives access to floating point Mathematical functions and operations
urllib – access internet and processing internet protocols
Smtplib – sending email
40
Graphical Interfaces
41
Notable Third-party Modules
42
Tools

More Related Content

What's hot

PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYAPYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYAMaulik Borsaniya
 
The Arrow Library in Kotlin
The Arrow Library in KotlinThe Arrow Library in Kotlin
The Arrow Library in KotlinGarth Gilmour
 
Coding in Kotlin with Arrow NIDC 2018
Coding in Kotlin with Arrow NIDC 2018Coding in Kotlin with Arrow NIDC 2018
Coding in Kotlin with Arrow NIDC 2018Garth Gilmour
 
Introduction to Python programming Language
Introduction to Python programming LanguageIntroduction to Python programming Language
Introduction to Python programming LanguageMansiSuthar3
 
Scala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To KnowScala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To KnowLightbend
 
Introduction to Python - Part Three
Introduction to Python - Part ThreeIntroduction to Python - Part Three
Introduction to Python - Part Threeamiable_indian
 
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...Ranel Padon
 
O caml2014 leroy-slides
O caml2014 leroy-slidesO caml2014 leroy-slides
O caml2014 leroy-slidesOCaml
 
Data types in python
Data types in pythonData types in python
Data types in pythonRaginiJain21
 
Python Interview Questions And Answers
Python Interview Questions And AnswersPython Interview Questions And Answers
Python Interview Questions And AnswersH2Kinfosys
 
Programming with Python - Week 3
Programming with Python - Week 3Programming with Python - Week 3
Programming with Python - Week 3Ahmet Bulut
 
Values and Data types in python
Values and Data types in pythonValues and Data types in python
Values and Data types in pythonJothi Thilaga P
 
Programming with Python - Week 2
Programming with Python - Week 2Programming with Python - Week 2
Programming with Python - Week 2Ahmet Bulut
 

What's hot (20)

PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYAPYTHON-Chapter 4-Plotting and Data Science  PyLab - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
 
The Arrow Library in Kotlin
The Arrow Library in KotlinThe Arrow Library in Kotlin
The Arrow Library in Kotlin
 
Coding in Kotlin with Arrow NIDC 2018
Coding in Kotlin with Arrow NIDC 2018Coding in Kotlin with Arrow NIDC 2018
Coding in Kotlin with Arrow NIDC 2018
 
Introduction to Python programming Language
Introduction to Python programming LanguageIntroduction to Python programming Language
Introduction to Python programming Language
 
Scala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To KnowScala 3 Is Coming: Martin Odersky Shares What To Know
Scala 3 Is Coming: Martin Odersky Shares What To Know
 
Introduction to Python - Part Three
Introduction to Python - Part ThreeIntroduction to Python - Part Three
Introduction to Python - Part Three
 
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
Python Programming - IV. Program Components (Functions, Classes, Modules, Pac...
 
Python basics
Python basicsPython basics
Python basics
 
LectureNotes-06-DSA
LectureNotes-06-DSALectureNotes-06-DSA
LectureNotes-06-DSA
 
Spsl vi unit final
Spsl vi unit finalSpsl vi unit final
Spsl vi unit final
 
An introduction to scala
An introduction to scalaAn introduction to scala
An introduction to scala
 
O caml2014 leroy-slides
O caml2014 leroy-slidesO caml2014 leroy-slides
O caml2014 leroy-slides
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Python Interview Questions And Answers
Python Interview Questions And AnswersPython Interview Questions And Answers
Python Interview Questions And Answers
 
Scala Paradigms
Scala ParadigmsScala Paradigms
Scala Paradigms
 
Clojure basics
Clojure basicsClojure basics
Clojure basics
 
Programming with Python - Week 3
Programming with Python - Week 3Programming with Python - Week 3
Programming with Python - Week 3
 
Python numbers
Python numbersPython numbers
Python numbers
 
Values and Data types in python
Values and Data types in pythonValues and Data types in python
Values and Data types in python
 
Programming with Python - Week 2
Programming with Python - Week 2Programming with Python - Week 2
Programming with Python - Week 2
 

Viewers also liked

Python Hype June
Python Hype JunePython Hype June
Python Hype JuneBrian Ray
 
Python Hype?
Python Hype?Python Hype?
Python Hype?Brian Ray
 
Wellcome to python
Wellcome to pythonWellcome to python
Wellcome to pythonNanra Sukedy
 
Bringing Down the House - How One Python Script Ruled Over AntiVirus
Bringing Down the House - How One Python Script Ruled Over AntiVirusBringing Down the House - How One Python Script Ruled Over AntiVirus
Bringing Down the House - How One Python Script Ruled Over AntiVirusCTruncer
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming LanguageDipankar Achinta
 
Building an EmPyre with Python
Building an EmPyre with PythonBuilding an EmPyre with Python
Building an EmPyre with PythonWill Schroeder
 
Introduction about Python by JanBask Training
Introduction about Python by JanBask TrainingIntroduction about Python by JanBask Training
Introduction about Python by JanBask TrainingJanBask Training
 
A Collaborative Approach to Teach Software Architecture - SIGCSE 2017
A Collaborative Approach to Teach Software Architecture - SIGCSE 2017A Collaborative Approach to Teach Software Architecture - SIGCSE 2017
A Collaborative Approach to Teach Software Architecture - SIGCSE 2017Maurício Aniche
 
Presentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackPresentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackDavid Sanchez
 
Python and Data Evangelism
Python and Data EvangelismPython and Data Evangelism
Python and Data EvangelismWon Bae Suh
 

Viewers also liked (16)

Python Hype June
Python Hype JunePython Hype June
Python Hype June
 
Data analysis with pandas
Data analysis with pandasData analysis with pandas
Data analysis with pandas
 
Python Hype?
Python Hype?Python Hype?
Python Hype?
 
Public Outreach - Running an effective campaign
 Public Outreach - Running an effective campaign  Public Outreach - Running an effective campaign
Public Outreach - Running an effective campaign
 
Hello World! with Python
Hello World! with PythonHello World! with Python
Hello World! with Python
 
Pydata-Python tools for webscraping
Pydata-Python tools for webscrapingPydata-Python tools for webscraping
Pydata-Python tools for webscraping
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Wellcome to python
Wellcome to pythonWellcome to python
Wellcome to python
 
Bringing Down the House - How One Python Script Ruled Over AntiVirus
Bringing Down the House - How One Python Script Ruled Over AntiVirusBringing Down the House - How One Python Script Ruled Over AntiVirus
Bringing Down the House - How One Python Script Ruled Over AntiVirus
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
 
Building an EmPyre with Python
Building an EmPyre with PythonBuilding an EmPyre with Python
Building an EmPyre with Python
 
Introduction about Python by JanBask Training
Introduction about Python by JanBask TrainingIntroduction about Python by JanBask Training
Introduction about Python by JanBask Training
 
A Collaborative Approach to Teach Software Architecture - SIGCSE 2017
A Collaborative Approach to Teach Software Architecture - SIGCSE 2017A Collaborative Approach to Teach Software Architecture - SIGCSE 2017
A Collaborative Approach to Teach Software Architecture - SIGCSE 2017
 
Presentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStackPresentation of Python, Django, DockerStack
Presentation of Python, Django, DockerStack
 
Python and Data Evangelism
Python and Data EvangelismPython and Data Evangelism
Python and Data Evangelism
 
Web scraping com python
Web scraping com pythonWeb scraping com python
Web scraping com python
 

Similar to James Jesus Bermas on Crash Course on Python

Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2Prerna Sharma
 
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docxCS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docxfaithxdunce63732
 
pythonlibrariesandmodules-210530042906.docx
pythonlibrariesandmodules-210530042906.docxpythonlibrariesandmodules-210530042906.docx
pythonlibrariesandmodules-210530042906.docxRameshMishra84
 
Introduction to python & its applications.ppt
Introduction to python & its applications.pptIntroduction to python & its applications.ppt
Introduction to python & its applications.pptPradeepNB2
 
Interview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfInterview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfExaminationSectionMR
 
unit (1)INTRODUCTION TO PYTHON course.pptx
unit (1)INTRODUCTION TO PYTHON course.pptxunit (1)INTRODUCTION TO PYTHON course.pptx
unit (1)INTRODUCTION TO PYTHON course.pptxusvirat1805
 
PPT on Python - illustrating Python for BBA, B.Tech
PPT on Python - illustrating Python for BBA, B.TechPPT on Python - illustrating Python for BBA, B.Tech
PPT on Python - illustrating Python for BBA, B.Techssuser2678ab
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsShanmuganathan C
 
PythonStudyMaterialSTudyMaterial.pdf
PythonStudyMaterialSTudyMaterial.pdfPythonStudyMaterialSTudyMaterial.pdf
PythonStudyMaterialSTudyMaterial.pdfdata2businessinsight
 
C463_02_python.ppt
C463_02_python.pptC463_02_python.ppt
C463_02_python.pptKapilMighani
 
kapil presentation.ppt
kapil presentation.pptkapil presentation.ppt
kapil presentation.pptKapilMighani
 
Top Python Online Training Institutes in Bangalore
Top Python Online Training Institutes in BangaloreTop Python Online Training Institutes in Bangalore
Top Python Online Training Institutes in BangaloreSaagTechnologies
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answerskavinilavuG
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2sadhana312471
 

Similar to James Jesus Bermas on Crash Course on Python (20)

Python cheat-sheet
Python cheat-sheetPython cheat-sheet
Python cheat-sheet
 
Programming in C sesion 2
Programming in C sesion 2Programming in C sesion 2
Programming in C sesion 2
 
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docxCS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
CS 360 LAB 3 STRINGS, FUNCTIONS, AND METHODSObjective The purpos.docx
 
pythonlibrariesandmodules-210530042906.docx
pythonlibrariesandmodules-210530042906.docxpythonlibrariesandmodules-210530042906.docx
pythonlibrariesandmodules-210530042906.docx
 
Introduction to python & its applications.ppt
Introduction to python & its applications.pptIntroduction to python & its applications.ppt
Introduction to python & its applications.ppt
 
Python for dummies
Python for dummiesPython for dummies
Python for dummies
 
Interview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfInterview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdf
 
unit (1)INTRODUCTION TO PYTHON course.pptx
unit (1)INTRODUCTION TO PYTHON course.pptxunit (1)INTRODUCTION TO PYTHON course.pptx
unit (1)INTRODUCTION TO PYTHON course.pptx
 
AI_2nd Lab.pptx
AI_2nd Lab.pptxAI_2nd Lab.pptx
AI_2nd Lab.pptx
 
PPT on Python - illustrating Python for BBA, B.Tech
PPT on Python - illustrating Python for BBA, B.TechPPT on Python - illustrating Python for BBA, B.Tech
PPT on Python - illustrating Python for BBA, B.Tech
 
OODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objectsOODP Unit 1 OOPs classes and objects
OODP Unit 1 OOPs classes and objects
 
PythonStudyMaterialSTudyMaterial.pdf
PythonStudyMaterialSTudyMaterial.pdfPythonStudyMaterialSTudyMaterial.pdf
PythonStudyMaterialSTudyMaterial.pdf
 
C463_02_python.ppt
C463_02_python.pptC463_02_python.ppt
C463_02_python.ppt
 
C463_02_python.ppt
C463_02_python.pptC463_02_python.ppt
C463_02_python.ppt
 
C463_02_python.ppt
C463_02_python.pptC463_02_python.ppt
C463_02_python.ppt
 
kapil presentation.ppt
kapil presentation.pptkapil presentation.ppt
kapil presentation.ppt
 
Top Python Online Training Institutes in Bangalore
Top Python Online Training Institutes in BangaloreTop Python Online Training Institutes in Bangalore
Top Python Online Training Institutes in Bangalore
 
Python for beginners
Python for beginnersPython for beginners
Python for beginners
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
These questions will be a bit advanced level 2
These questions will be a bit advanced level 2These questions will be a bit advanced level 2
These questions will be a bit advanced level 2
 

More from CP-Union

Albert Gavino on FOSS in Data Science and Analysis
Albert Gavino on FOSS in Data Science and AnalysisAlbert Gavino on FOSS in Data Science and Analysis
Albert Gavino on FOSS in Data Science and AnalysisCP-Union
 
Tito Mari Escaño on The Better Alternative Development and Startup Platform; ...
Tito Mari Escaño on The Better Alternative Development and Startup Platform; ...Tito Mari Escaño on The Better Alternative Development and Startup Platform; ...
Tito Mari Escaño on The Better Alternative Development and Startup Platform; ...CP-Union
 
Jojit Ballesteros on Introduction to Wikimedia
Jojit Ballesteros on Introduction to WikimediaJojit Ballesteros on Introduction to Wikimedia
Jojit Ballesteros on Introduction to WikimediaCP-Union
 
Gerald Villorente on Intro to Docker
Gerald Villorente on Intro to DockerGerald Villorente on Intro to Docker
Gerald Villorente on Intro to DockerCP-Union
 
Eladio Abquina on FOSS TOOL for Mining Big Data;OCC PORTAL Dashboard Story
Eladio Abquina on FOSS TOOL for Mining Big Data;OCC PORTAL Dashboard StoryEladio Abquina on FOSS TOOL for Mining Big Data;OCC PORTAL Dashboard Story
Eladio Abquina on FOSS TOOL for Mining Big Data;OCC PORTAL Dashboard StoryCP-Union
 
Rep. Carlos Zarate on FOSS and FOI Bill: Status and Ways Forward
Rep. Carlos Zarate on FOSS and FOI Bill: Status and Ways ForwardRep. Carlos Zarate on FOSS and FOI Bill: Status and Ways Forward
Rep. Carlos Zarate on FOSS and FOI Bill: Status and Ways ForwardCP-Union
 
Renan Mara on What is FOSS and SFD.
Renan Mara on What is FOSS and SFD.Renan Mara on What is FOSS and SFD.
Renan Mara on What is FOSS and SFD.CP-Union
 
Almondz Almodal on Change We Need: FOSS, Better Internet, Data Privacy, atbp.
Almondz Almodal on Change We Need: FOSS, Better Internet, Data Privacy, atbp.Almondz Almodal on Change We Need: FOSS, Better Internet, Data Privacy, atbp.
Almondz Almodal on Change We Need: FOSS, Better Internet, Data Privacy, atbp.CP-Union
 
On the cybercrime act
On the cybercrime actOn the cybercrime act
On the cybercrime actCP-Union
 
Foss and ict for the people
Foss and ict for the peopleFoss and ict for the people
Foss and ict for the peopleCP-Union
 
Drupal for Non-Profits
Drupal for Non-ProfitsDrupal for Non-Profits
Drupal for Non-ProfitsCP-Union
 

More from CP-Union (11)

Albert Gavino on FOSS in Data Science and Analysis
Albert Gavino on FOSS in Data Science and AnalysisAlbert Gavino on FOSS in Data Science and Analysis
Albert Gavino on FOSS in Data Science and Analysis
 
Tito Mari Escaño on The Better Alternative Development and Startup Platform; ...
Tito Mari Escaño on The Better Alternative Development and Startup Platform; ...Tito Mari Escaño on The Better Alternative Development and Startup Platform; ...
Tito Mari Escaño on The Better Alternative Development and Startup Platform; ...
 
Jojit Ballesteros on Introduction to Wikimedia
Jojit Ballesteros on Introduction to WikimediaJojit Ballesteros on Introduction to Wikimedia
Jojit Ballesteros on Introduction to Wikimedia
 
Gerald Villorente on Intro to Docker
Gerald Villorente on Intro to DockerGerald Villorente on Intro to Docker
Gerald Villorente on Intro to Docker
 
Eladio Abquina on FOSS TOOL for Mining Big Data;OCC PORTAL Dashboard Story
Eladio Abquina on FOSS TOOL for Mining Big Data;OCC PORTAL Dashboard StoryEladio Abquina on FOSS TOOL for Mining Big Data;OCC PORTAL Dashboard Story
Eladio Abquina on FOSS TOOL for Mining Big Data;OCC PORTAL Dashboard Story
 
Rep. Carlos Zarate on FOSS and FOI Bill: Status and Ways Forward
Rep. Carlos Zarate on FOSS and FOI Bill: Status and Ways ForwardRep. Carlos Zarate on FOSS and FOI Bill: Status and Ways Forward
Rep. Carlos Zarate on FOSS and FOI Bill: Status and Ways Forward
 
Renan Mara on What is FOSS and SFD.
Renan Mara on What is FOSS and SFD.Renan Mara on What is FOSS and SFD.
Renan Mara on What is FOSS and SFD.
 
Almondz Almodal on Change We Need: FOSS, Better Internet, Data Privacy, atbp.
Almondz Almodal on Change We Need: FOSS, Better Internet, Data Privacy, atbp.Almondz Almodal on Change We Need: FOSS, Better Internet, Data Privacy, atbp.
Almondz Almodal on Change We Need: FOSS, Better Internet, Data Privacy, atbp.
 
On the cybercrime act
On the cybercrime actOn the cybercrime act
On the cybercrime act
 
Foss and ict for the people
Foss and ict for the peopleFoss and ict for the people
Foss and ict for the people
 
Drupal for Non-Profits
Drupal for Non-ProfitsDrupal for Non-Profits
Drupal for Non-Profits
 

Recently uploaded

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 

Recently uploaded (20)

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 

James Jesus Bermas on Crash Course on Python

  • 3. 3 What is Python? Created by Guido Van Rossum as a successor to the ABC programming language Conceived in 1980, started development in 1989, v1.0 out in 1994 Name is derived from Monty Python’s Flying Circus
  • 4. 4 Python in the real world Uses millions of lines of Python code for ad management to build automation Employs the creator of Python himself
  • 5. 5 Python in the real world Industrial Light & Magic Uses Python to automate visual effects
  • 6. 6 Python in the real world Uses Python for their desktop application Python automates the synchronization and file sending over the internet to Dropbox’s cloud storage servers
  • 7. 7 Python in the real world Django web framework is built using Python Notable users of Django are some of the biggest websites today
  • 8. 8 Python in the real world Blender, a 3D Imaging program uses Python as its main scripting language
  • 9. 9 Python in the real world Minecraft uses Python as its scripting language to automate building
  • 10. 10 Python in the real world Google Industrial Light and Magic (Star Wars) Django web framework (used in Pinterest, Instagram, Mozilla) Dropbox Reddit LibreOffice Games (Battlefield, EVE Online, Civilization IV, Minecraft, etc.) ...and many more!
  • 11. 11 Why Python? Simple, like speaking English It’s FOSS! Lots of resources available High level programming language Object-oriented, but not enforced Portable, works on a lot of different systems Can be embedded in programs for scripting capabilities Extensive libraries available Extensible
  • 12. 12 Getting Started Go to https://www.python.org and download the latest version of Python for your OS
  • 13. 13 Installing on Windows Add Python 3.5 to PATH
  • 14. 14 Running Python Run the Python interpreter by typing “python” in the command line
  • 15. 15 Basic Characteristics Organized syntax Indentation is strictly enforced Encourages proper programming practices Dynamic variable typing Variables are simply names that refer to objects No defined data type during compile time
  • 16. 16 Simple and Readable Python programs look like pseudo-code compared to other prominent languages Sample code – helloworld.py
  • 17. 17 Indentation Proper Indentation is enforced to identify sections within your program (functions, procedures, classes) Sample code – guessgame.py
  • 19. 19 Built-in Data Types Boolean Numbers (integers, real, complex) Strings Sequence Types Tuples Lists (resize-able arrays) Range Set Types Set, FrozenSet Dictionary
  • 20. 20 Data Types – Tuples class tuple([iterable]) Immutable sequence of data – once assigned, elements within cannot be changed Using a pair of parentheses to denote the empty tuple: () Using a trailing comma for a singleton tuple: a, or (a,) Separating items with commas: a, b, c or (a, b, c) Using the tuple() built-in: tuple() or tuple(iterable)
  • 21. 21 Data Types – Tuples Sample code: Output:
  • 22. 22 Data Types – Tuples Python Expression Result Description Len((1,2,3)) 3 Length (1,2,3) + (4,5,6) (1,2,3,4,5,6) Concatenation ('Hi!',) * 4 ('Hi!', 'Hi!', 'Hi!', 'Hi!') Repetition 3 in (1, 2, 3) True Membership for x in (1, 2, 3): print(x) 1 2 3 Iteration Basic tuple operations
  • 23. 23 Data Types – List class list([iterable]) Mutable sequence of data – once assigned, elements within cannot be changed Using a pair of square brackets to denote the empty list: [] Using square brackets, separating items with commas: [a], [a, b, c] Using a list comprehension: [x for x in iterable] Using the type constructor: list() or list(iterable)
  • 24. 24 Data Types – List Sample code: Output:
  • 25. 25 Data Types – List Basic list operations Python Expression Result Description Len([1,2,3]) 3 Length [1,2,3] + [4,5,6] [1,2,3,4,5,6] Concatenation ['Hi!',] * 4 ['Hi!', 'Hi!', 'Hi!', 'Hi!'] Repetition 3 in [1, 2, 3] True Membership for x in [1, 2, 3]: print(x) 1 2 3 Iteration
  • 26. 26 Built-in Functions Some built-in functions that work with tuples and lists min() - Return the smallest item max() - Return the largest item len() - Return the length of the object sorted() - Sorts an iterable object
  • 27. 27 When to use Tuple and List A tuple’s contents cannot be changed individually once assigned Each element of a list can be dynamically assigned
  • 28. 28 Data Types – Range class range(stop) class range(start, stop[, step]) Represents an immutable sequence of numbers and is commonly used for looping a specific number of times start - The value of the start parameter (or 0 if the parameter was not supplied) stop - The value of the stop parameter step - The value of the step parameter (or 1 if the parameter was not supplied) It only stores the start, stop and step values, calculating individual items and subranges as needed
  • 29. 29 Data Types – Range Sample code and output:
  • 30. 30 Data Types – Set class set([iterable]) class frozenset([iterable]) An unordered collection of distinct hashable (non-dynamic) objects Common use includes membership testing, removing duplicates from a sequence, mathematical operations (union, intersection, difference, symmetric difference)
  • 31. 31 Data Types – Set Sample code and output:
  • 32. 32 Data Types – Dictionary class dict(**kwarg) class dict(mapping, **kwarg) class dict(iterable, **kwarg) Immutable sequence of data – once assigned, elements within cannot be changed Can be created by placing a comma-separated list of key: value pairs within braces Example: {'apple': 10, 'orange': 12} or {10: 'apple', 12: 'orange'}, or by the dict() constructor
  • 33. 33 Data Types – Dictionary Sample code: Output:
  • 34. 34 Defining Functions You can define functions to provide the required functionality. Here are simple rules to define a function in Python. Function blocks begin with the keyword def followed by the function name and parentheses ( ( ) ). Any input parameters or arguments should be placed within these parentheses. You can also define parameters inside these parentheses. The first statement of a function can be an optional statement - the documentation string of the function or docstring. The code block within every function starts with a colon (:) and is indented. The statement return [expression] exits a function. A return statement with no arguments is the same as return None.
  • 36. 36 Object-oriented Programming Object: A unique instance of a data structure that's defined by its class. An object comprises both data members (class variables and instance variables) and methods. Class: A user-defined prototype for an object that defines a set of attributes that characterize any object of the class. The attributes are data members (class variables and instance variables) and methods, accessed via dot notation. Class variable: A variable that is shared by all instances of a class. Class variables are defined within a class but outside any of the class's methods. Class variables are not used as frequently as instance variables are. Data member: A class variable or instance variable that holds data associated with a class and its objects.
  • 37. 37 Object-oriented Programming Instance variable: A variable that is defined inside a method and belongs only to the current instance of a class. Inheritance: The transfer of the characteristics of a class to other classes that are derived from it. Instance: An individual object of a certain class. An object obj that belongs to a class Circle, for example, is an instance of the class Circle. Instantiation: The creation of an instance of a class. Method : A special kind of function that is defined in a class definition.
  • 38. 38 Object-oriented Programming In this example, we can see a basic demonstration of using Classes and Object-Oriented programming Class → Employee Class variable → empCount Data member → name, salary Instance → emp1 and emp2 Inhertiance → emp1 and emp2 inherits the properties of the class Employee Method → displayCount(), displayEmployee()
  • 39. 39 Commonly Used Standard Modules time – provides objects and functions for working with Time calendar - provides objects and functions for working with Dates os, shutil – contains functions that allow Python to interact with the operating system and the shell sys – common utility scripts needed to process command line arguments re – regular expression tools for advanced string processing math – gives access to floating point Mathematical functions and operations urllib – access internet and processing internet protocols Smtplib – sending email

Editor's Notes

  1. Let's agree of what it means, or at least convey a general consensus