際際滷

際際滷Share a Scribd company logo
PYTHON
Submitted by:
Shivam Gupta(1318710097)
Shashendra Singh(1318710094)
What We Give you?
 What is Python?
 Differences between program and scripting language
 History of Python
 Scope of Python
 What can I do with python
 Who uses python today
 Why do people use Python?
 Installing Python IDE
 A Sample Code
 Python code execution
 Running Python
 Python Basic(Variable, Strings, Data types etc.)
2
What is Python?
 Python is a general purpose programming language that is
often applied in scripting roles.
 So, Python is programming language as well as scripting
language.
 Python is also called as Interpreted language
3
Differences between program and
scripting language
Program Scripting
 a program is executed (i.e.
the source is first compiled,
and the result of that
compilation is expected)
 A "program" in general, is a
sequence of instructions
written so that a computer
can perform certain task.
 a script is interpreted
 A "script" is code written in
a scripting language. A
scripting language is nothing
but a type of programming
language in which we can
write code to control
another software application.
4
History
 Invented in the Netherlands, early 90s by Guido van
Rossum
 Python was conceived in the late 1980s and its
implementation was started in December 1989
 Guido Van Rossum is fan of Monty Pythons Flying
Circus, this is a famous TV show in Netherlands
 Named after Monty Python
 Open sourced from the beginning
5
Pythons Benevolent Dictator For Life
Python is an experiment in how
much freedom programmers need.
Too much freedom and nobody can
read another's code; too little and
expressiveness is endangered.
- Guido van Rossum
6
Why was python created?
"My original motivation for creating Python was the
perceived need for a higher level language in the
Amoeba [Operating Systems] project.
I realized that the development of system
administration utilities in C was taking too long.
Moreover, doing these things in the Bourne shell
wouldn't work for a variety of reasons. ...
So, there was a need for a language that
would bridge the gap between C and the shell
- Guido Van Rossum
7
Scope of Python
 Science
- Bioinformatics
 System Administration
-Unix
-Web logic
-Web sphere
 Web Application Development
-CGI
-Jython  Servlets
 Testing scripts
8
What can I do with Python?
 System programming
 Graphical User Interface Programming
 Internet Scripting
 Component Integration
 Database Programming
 Gaming, Images, XML , Robot and more
9
Who uses python today
 Python is being applied in real revenue-generating products
by real companies. For instance:
 Google makes extensive use of Python in its web search
system, and employs Pythons creator.
 Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM
use Python for hardware testing.
 ESRI uses Python as an end-user customization tool for its
popular GIS mapping products.
 The YouTube video sharing service is largely written in
Python
10
Why do people use Python?
The following primary factors cited by Python users
seem to be these:
 Python is object-oriented
Structure supports such concepts as polymorphism,
operation overloading, and multiple inheritance.
.
 It's free (open source)
Downloading and installing Python is free and easy
Source code is easily accessible
11
 It's powerful
- Dynamic typing
- Built-in types and tools
- Library utilities
- Third party utilities (e.g. Numeric, NumPy, SciPy)
- Automatic memory management
 It's portable
- Python runs virtually every major platform used today
- As long as you have a compatible Python interpreter
installed, Python programs will run in exactly the same
manner, irrespective of platform.
12
Installing Python
 Python is pre-installed on most Unix systems, including Linux
and MAC OS X
 But for in Windows Operating Systems , user can
download from the
https://www.python.org/downloads/
- from the above link download latest version of
python IDE and install, recent version is 3.4.1 but
most of them uses version 2.7.7 only
13
 After installing the
Python Ver#2.7.7, go to
start menu then click on
python 2.7 in that one
you can select python
(command line) it is
prompt with >>>
14
15
Running Python
Once you're inside the Python interpreter, type in commands at will.
 Examples:
>>> print 'Hello world'
Hello world
16
Python Code Execution
 Pythons traditional runtime execution model: source code
you type is translated to byte code, which is then run by the
Python Virtual Machine. Your code is automatically
compiled, but then it is interpreted.
Source code extension is .py
Byte code extension is .pyc (compiled python code)
17
MATH(OPERATOR) IN PYTHON
Math
Try typing this into Code:
>>> print 3 + 12
15
>>> print 12  3
9
>>> print 9 + 5  15 + 12
11
Operators:
add: +
subtract: -
Note: dont type the arrows >>> !
19
Math
Rule: If you want Python to answer in floats, you have to
talk to it in floats.
More operators:
divide: /
multiply: *
>>> print 3 * 12 36
>>> print 12 / 3 4
>>> print 11 / 3 3
>>> print 12.0 / 3.0 4.0
>>> print 11.0 / 3.0 3.66
20
Math
Practice:
>>> print 2 < 3 True
>>> print 2 <= 2 False
>>> print 3 > 2 True
>>> print 2 != 3 True
>>> print False < True True
21
STRINGS IN PYTHON
22
Strings
Examples:
Try typing one without quotes:
Whats the result?
>>> Its a beautiful
day!
>>> Goodbye, cruel
world.
>>> Aggies
>>> Aggies
>>> Rice fight, never
die!
>>> 3 + 2
23
Strings
String operators:
concatenation: +
multiplication: *
Try concatenating:
Try multiplying:
>>> print Hello +
  + world!
>>> print HAHA *
250
24
VARIABLES IN PYTHON
25
Variable
>>>headmaster=Dumbledore
>>>print headmaster
Dumbledore
Create a Variable:
Assigning a New Value:
>>>headmaster=Hardcastle
>>>print headmaster
Hardcastle
26
DATA TYPES IN PYTHON
28
Data Type:
Python has many native data types. Here are the important ones:
Booleans are either True or False.
Numbers can be integers (1 and 2), floats (1.1 and 1.2), fractions
(1/2 and 2/3), or even complex numbers.
Strings are sequences of Unicode characters, e.g. an HTML
document.
Bytes and byte arrays, e.g. a JPEG image file.
Lists are ordered sequences of values.
Tuples are ordered, immutable sequences of values.
Sets are unordered bags of values.
Example:
29
String Whoop!
Integer 42
Float 3.14159
List [John, Paul, George, Ringo]
Python can tell us about types using the type()
function:
>>> print type(Whoop!)
<type str>
LIST: DATA TYPE
30
31
List:
The list is a most versatile Data type available in Python
which can be written as a list of comma-separated values
(items) between square brackets. Important thing about a
list is that items in a list need not be of the same type.
Example:
list1 = ['physics', 'chemistry', 1997, 2000];
list2 = [1, 2, 3, 4, 5 ];
32
SN Function with Description
1 cmp(list1, list2) Compares elements of both lists.
2 len(list) Gives the total length of the list.
3 max(list) Returns item from the list with max value.
4 min(list) Returns item from the list with min value.
5 list(seq) Converts a tuple into list.
List: a sequence of objects
>>> Beatles = [John, Paul, George,
Ringo]
>>> grades = [82, 93, 67, 99, 100]
Guess what this will output:
>>> type(Beatles)
>>> type(grades)
33
Lists
Index: Where an item is in the list
>>> Beatles = [John, Paul, George,
Ringo]
>>> Beatles[0]
John
[John, Paul, George, Ringo]
0 1 2 3
Python always starts at zero!
34
TUPLE: DATA TYPE
36
Tuples:
A tuple is a sequence of immutable Python objects. Tuples are
sequences, just like lists. The differences between tuples and
lists are, the tuples cannot be changed unlike lists and tuples
use parentheses, whereas lists use square brackets.
Example:
tup2 = (1, 2, 3, 4, 5 );
tup3 = ("a", "b", "c", "d);
Accessing Values:
print "tup2[1:5]: 
Output:
tup2[1:5]: [2, 3, 4, 5]
37
Built-in Tuple Functions
Python includes the following tuple functions 
SN Function with Description
1 cmp(tuple1, tuple2) Compares elements of both tuples.
2 len(tuple) Gives the total length of the tuple.
3 max(tuple) Returns item from the tuple with max value.
4 min(tuple) Returns item from the tuple with min value.
5 tuple(seq) Converts a list into tuple.
LOOPS & CONDITIONAL
STATEMENTS
38
39
Loop Type Description
while loop Repeats a statement or group of statements
while a given condition is TRUE. It tests the
condition before executing the loop body.
for loop Executes a sequence of statements multiple
times and abbreviates the code that
manages the loop variable.
nested loops You can use one or more loop inside any
another while, for or do..while loop.
40
Statement Description
if statements An if statement consists of a boolean expression
followed by one or more statements.
if...else statements An if statement can be followed by an
optional else statement, which executes when
the boolean expression is FALSE.
nested if statements You can use one if or else if statement inside
another if or else if statement(s).
41
I believe the trial has shown conclusively that it is both possible and
desirable to use Python as the principal teaching language:
o It is Free (as in both cost and source code).
o It is trivial to install on a Windows PC allowing students to take
their interest further. For many the hurdle of installing a Pascal or
C compiler on a Windows machine is either too expensive or too
complicated;
o It is a flexible tool that allows both the teaching of traditional
procedural programming and modern OOP; It can be used to
teach a large number of transferable skills;
o It is a real-world programming language that can be and is used in
academia and the commercial world;
o It appears to be quicker to learn and, in combination with its many
libraries, this offers the possibility of more rapid student
development allowing the course to be made more challenging
and varied;
o and most importantly, its clean syntax offers increased
understanding and enjoyment for students;
42

More Related Content

What's hot (20)

Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
Devashish Kumar
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
Abhijeet Singh
Python basic
Python basicPython basic
Python basic
Saifuddin Kaijar
Data types in python
Data types in pythonData types in python
Data types in python
RaginiJain21
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
Nowell Strite
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
Emertxe Information Technologies Pvt Ltd
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
NUMPY
NUMPY NUMPY
NUMPY
SharmilaChidaravalli
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
Iqra khalil
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
Srinivas Narasegouda
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
william john
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
CPD INDIA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Maulik Borsaniya
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
Shuvongkor Barman
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| Fundamentals
Mohd Sajjad
Functions in python slide share
Functions in python slide shareFunctions in python slide share
Functions in python slide share
Devashish Kumar
Python and its Applications
Python and its ApplicationsPython and its Applications
Python and its Applications
Abhijeet Singh
Data types in python
Data types in pythonData types in python
Data types in python
RaginiJain21
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
Nowell Strite
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
Iqra khalil
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
Srinivas Narasegouda
Presentation on python
Presentation on pythonPresentation on python
Presentation on python
william john
oops concept in java | object oriented programming in java
oops concept in java | object oriented programming in javaoops concept in java | object oriented programming in java
oops concept in java | object oriented programming in java
CPD INDIA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Maulik Borsaniya
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
Shuvongkor Barman
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
Python-01| Fundamentals
Python-01| FundamentalsPython-01| Fundamentals
Python-01| Fundamentals
Mohd Sajjad

Similar to Python Seminar PPT (20)

Python Introduction
Python IntroductionPython Introduction
Python Introduction
Punithavel Ramani
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
Arpittripathi45
python presentation
python presentationpython presentation
python presentation
VaibhavMawal
05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
SugumarSarDurai
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
MohammadSamiuddin10
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdfREPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
Sana Khan
Python intro
Python introPython intro
Python intro
rik0
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
R.h. Himel
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
abinayas958164
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
abinayas958164
python introduction initial lecture unit1.pptx
python introduction initial lecture unit1.pptxpython introduction initial lecture unit1.pptx
python introduction initial lecture unit1.pptx
ChandraPrakash715640
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
Introduction python
Introduction pythonIntroduction python
Introduction python
Jumbo Techno e_Learning
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
lemonchoos
Python Tutorial | Python Programming Language
Python Tutorial | Python Programming LanguagePython Tutorial | Python Programming Language
Python Tutorial | Python Programming Language
anaveenkumar4
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Mohammed Rafi
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdfTraining report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
YadavHarshKr
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
KPDDRAVIDIAN
Python tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academyPython tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academy
TIB Academy
python presntation 2.pptx
python presntation 2.pptxpython presntation 2.pptx
python presntation 2.pptx
Arpittripathi45
python presentation
python presentationpython presentation
python presentation
VaibhavMawal
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdfREPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
REPORT ON AUDIT COURSE PYTHON BY SANA 2.pdf
Sana Khan
Python intro
Python introPython intro
Python intro
rik0
Phython Programming Language
Phython Programming LanguagePhython Programming Language
Phython Programming Language
R.h. Himel
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
abinayas958164
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
20210517-PYTHON AI&DS PROGRAMMING NOTES.pdf
abinayas958164
python introduction initial lecture unit1.pptx
python introduction initial lecture unit1.pptxpython introduction initial lecture unit1.pptx
python introduction initial lecture unit1.pptx
ChandraPrakash715640
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
gabriellekuruvilla
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
lemonchoos
Python Tutorial | Python Programming Language
Python Tutorial | Python Programming LanguagePython Tutorial | Python Programming Language
Python Tutorial | Python Programming Language
anaveenkumar4
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
Mohammed Rafi
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdfTraining report 1923-b.e-eee-batchno--intern-54 (1).pdf
Training report 1923-b.e-eee-batchno--intern-54 (1).pdf
YadavHarshKr
Python tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academyPython tutorial for beginners - Tib academy
Python tutorial for beginners - Tib academy
TIB Academy

Recently uploaded (20)

decarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptxdecarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptx
gonzalezolabarriaped
only history of java.pptx real bihind the name java
only history of java.pptx real bihind the name javaonly history of java.pptx real bihind the name java
only history of java.pptx real bihind the name java
mushtaqsaliq9
Wireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdfWireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdf
AbhinandanMishra30
autonomous vehicle project for engineering.pdf
autonomous vehicle project for engineering.pdfautonomous vehicle project for engineering.pdf
autonomous vehicle project for engineering.pdf
JyotiLohar6
Air pollution is contamination of the indoor or outdoor environment by any ch...
Air pollution is contamination of the indoor or outdoor environment by any ch...Air pollution is contamination of the indoor or outdoor environment by any ch...
Air pollution is contamination of the indoor or outdoor environment by any ch...
dhanashree78
Lessons learned when managing MySQL in the Cloud
Lessons learned when managing MySQL in the CloudLessons learned when managing MySQL in the Cloud
Lessons learned when managing MySQL in the Cloud
Igor Donchovski
Unit II: Design of Static Equipment Foundations
Unit II: Design of Static Equipment FoundationsUnit II: Design of Static Equipment Foundations
Unit II: Design of Static Equipment Foundations
Sanjivani College of Engineering, Kopargaon
Best KNow Hydrogen Fuel Production in the World The cost in USD kwh for H2
Best KNow  Hydrogen Fuel Production in the World The cost in USD kwh for H2Best KNow  Hydrogen Fuel Production in the World The cost in USD kwh for H2
Best KNow Hydrogen Fuel Production in the World The cost in USD kwh for H2
Daniel Donatelli
BS_EN_ISO_19650_Detailed_Presentation.pptx
BS_EN_ISO_19650_Detailed_Presentation.pptxBS_EN_ISO_19650_Detailed_Presentation.pptx
BS_EN_ISO_19650_Detailed_Presentation.pptx
VinkuMeena
Frankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkundeFrankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkunde
Lisa Emerson
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptxRAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
JenTeruel1
decarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptxdecarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptx
gonzalezolabarriaped
Lecture -3 Cold water supply system.pptx
Lecture -3 Cold water supply system.pptxLecture -3 Cold water supply system.pptx
Lecture -3 Cold water supply system.pptx
rabiaatif2
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
CS3451-OPERATING-SYSTEM NOTES ALL123.pdfCS3451-OPERATING-SYSTEM NOTES ALL123.pdf
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
PonniS7
04 MAINTENANCE OF CONCRETE PAVEMENTS.ppt
04  MAINTENANCE OF CONCRETE PAVEMENTS.ppt04  MAINTENANCE OF CONCRETE PAVEMENTS.ppt
04 MAINTENANCE OF CONCRETE PAVEMENTS.ppt
sreenath seenu
Equipment for Gas Metal Arc Welding Process
Equipment for Gas Metal Arc Welding ProcessEquipment for Gas Metal Arc Welding Process
Equipment for Gas Metal Arc Welding Process
AhmadKamil87
Engineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdfEngineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdf
Sona
Mathematics_behind_machine_learning_INT255.pptx
Mathematics_behind_machine_learning_INT255.pptxMathematics_behind_machine_learning_INT255.pptx
Mathematics_behind_machine_learning_INT255.pptx
ppkmurthy2006
AI, Tariffs and Supply Chains in Knowledge Graphs
AI, Tariffs and Supply Chains in Knowledge GraphsAI, Tariffs and Supply Chains in Knowledge Graphs
AI, Tariffs and Supply Chains in Knowledge Graphs
Max De Marzi
Lectureof nano 1588236675-biosensors (1).ppt
Lectureof nano 1588236675-biosensors (1).pptLectureof nano 1588236675-biosensors (1).ppt
Lectureof nano 1588236675-biosensors (1).ppt
SherifElGohary7
decarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptxdecarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptx
gonzalezolabarriaped
only history of java.pptx real bihind the name java
only history of java.pptx real bihind the name javaonly history of java.pptx real bihind the name java
only history of java.pptx real bihind the name java
mushtaqsaliq9
Wireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdfWireless-Charger presentation for seminar .pdf
Wireless-Charger presentation for seminar .pdf
AbhinandanMishra30
autonomous vehicle project for engineering.pdf
autonomous vehicle project for engineering.pdfautonomous vehicle project for engineering.pdf
autonomous vehicle project for engineering.pdf
JyotiLohar6
Air pollution is contamination of the indoor or outdoor environment by any ch...
Air pollution is contamination of the indoor or outdoor environment by any ch...Air pollution is contamination of the indoor or outdoor environment by any ch...
Air pollution is contamination of the indoor or outdoor environment by any ch...
dhanashree78
Lessons learned when managing MySQL in the Cloud
Lessons learned when managing MySQL in the CloudLessons learned when managing MySQL in the Cloud
Lessons learned when managing MySQL in the Cloud
Igor Donchovski
Best KNow Hydrogen Fuel Production in the World The cost in USD kwh for H2
Best KNow  Hydrogen Fuel Production in the World The cost in USD kwh for H2Best KNow  Hydrogen Fuel Production in the World The cost in USD kwh for H2
Best KNow Hydrogen Fuel Production in the World The cost in USD kwh for H2
Daniel Donatelli
BS_EN_ISO_19650_Detailed_Presentation.pptx
BS_EN_ISO_19650_Detailed_Presentation.pptxBS_EN_ISO_19650_Detailed_Presentation.pptx
BS_EN_ISO_19650_Detailed_Presentation.pptx
VinkuMeena
Frankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkundeFrankfurt University of Applied Science urkunde
Frankfurt University of Applied Science urkunde
Lisa Emerson
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptxRAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
RAMSES- EDITORIAL SAMPLE FOR DSSPC C.pptx
JenTeruel1
decarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptxdecarbonization steel industry rev1.pptx
decarbonization steel industry rev1.pptx
gonzalezolabarriaped
Lecture -3 Cold water supply system.pptx
Lecture -3 Cold water supply system.pptxLecture -3 Cold water supply system.pptx
Lecture -3 Cold water supply system.pptx
rabiaatif2
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
CS3451-OPERATING-SYSTEM NOTES ALL123.pdfCS3451-OPERATING-SYSTEM NOTES ALL123.pdf
CS3451-OPERATING-SYSTEM NOTES ALL123.pdf
PonniS7
04 MAINTENANCE OF CONCRETE PAVEMENTS.ppt
04  MAINTENANCE OF CONCRETE PAVEMENTS.ppt04  MAINTENANCE OF CONCRETE PAVEMENTS.ppt
04 MAINTENANCE OF CONCRETE PAVEMENTS.ppt
sreenath seenu
Equipment for Gas Metal Arc Welding Process
Equipment for Gas Metal Arc Welding ProcessEquipment for Gas Metal Arc Welding Process
Equipment for Gas Metal Arc Welding Process
AhmadKamil87
Engineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdfEngineering at Lovely Professional University (LPU).pdf
Engineering at Lovely Professional University (LPU).pdf
Sona
Mathematics_behind_machine_learning_INT255.pptx
Mathematics_behind_machine_learning_INT255.pptxMathematics_behind_machine_learning_INT255.pptx
Mathematics_behind_machine_learning_INT255.pptx
ppkmurthy2006
AI, Tariffs and Supply Chains in Knowledge Graphs
AI, Tariffs and Supply Chains in Knowledge GraphsAI, Tariffs and Supply Chains in Knowledge Graphs
AI, Tariffs and Supply Chains in Knowledge Graphs
Max De Marzi
Lectureof nano 1588236675-biosensors (1).ppt
Lectureof nano 1588236675-biosensors (1).pptLectureof nano 1588236675-biosensors (1).ppt
Lectureof nano 1588236675-biosensors (1).ppt
SherifElGohary7

Python Seminar PPT

  • 2. What We Give you? What is Python? Differences between program and scripting language History of Python Scope of Python What can I do with python Who uses python today Why do people use Python? Installing Python IDE A Sample Code Python code execution Running Python Python Basic(Variable, Strings, Data types etc.) 2
  • 3. What is Python? Python is a general purpose programming language that is often applied in scripting roles. So, Python is programming language as well as scripting language. Python is also called as Interpreted language 3
  • 4. Differences between program and scripting language Program Scripting a program is executed (i.e. the source is first compiled, and the result of that compilation is expected) A "program" in general, is a sequence of instructions written so that a computer can perform certain task. a script is interpreted A "script" is code written in a scripting language. A scripting language is nothing but a type of programming language in which we can write code to control another software application. 4
  • 5. History Invented in the Netherlands, early 90s by Guido van Rossum Python was conceived in the late 1980s and its implementation was started in December 1989 Guido Van Rossum is fan of Monty Pythons Flying Circus, this is a famous TV show in Netherlands Named after Monty Python Open sourced from the beginning 5
  • 6. Pythons Benevolent Dictator For Life Python is an experiment in how much freedom programmers need. Too much freedom and nobody can read another's code; too little and expressiveness is endangered. - Guido van Rossum 6
  • 7. Why was python created? "My original motivation for creating Python was the perceived need for a higher level language in the Amoeba [Operating Systems] project. I realized that the development of system administration utilities in C was taking too long. Moreover, doing these things in the Bourne shell wouldn't work for a variety of reasons. ... So, there was a need for a language that would bridge the gap between C and the shell - Guido Van Rossum 7
  • 8. Scope of Python Science - Bioinformatics System Administration -Unix -Web logic -Web sphere Web Application Development -CGI -Jython Servlets Testing scripts 8
  • 9. What can I do with Python? System programming Graphical User Interface Programming Internet Scripting Component Integration Database Programming Gaming, Images, XML , Robot and more 9
  • 10. Who uses python today Python is being applied in real revenue-generating products by real companies. For instance: Google makes extensive use of Python in its web search system, and employs Pythons creator. Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM use Python for hardware testing. ESRI uses Python as an end-user customization tool for its popular GIS mapping products. The YouTube video sharing service is largely written in Python 10
  • 11. Why do people use Python? The following primary factors cited by Python users seem to be these: Python is object-oriented Structure supports such concepts as polymorphism, operation overloading, and multiple inheritance. . It's free (open source) Downloading and installing Python is free and easy Source code is easily accessible 11
  • 12. It's powerful - Dynamic typing - Built-in types and tools - Library utilities - Third party utilities (e.g. Numeric, NumPy, SciPy) - Automatic memory management It's portable - Python runs virtually every major platform used today - As long as you have a compatible Python interpreter installed, Python programs will run in exactly the same manner, irrespective of platform. 12
  • 13. Installing Python Python is pre-installed on most Unix systems, including Linux and MAC OS X But for in Windows Operating Systems , user can download from the https://www.python.org/downloads/ - from the above link download latest version of python IDE and install, recent version is 3.4.1 but most of them uses version 2.7.7 only 13
  • 14. After installing the Python Ver#2.7.7, go to start menu then click on python 2.7 in that one you can select python (command line) it is prompt with >>> 14
  • 15. 15
  • 16. Running Python Once you're inside the Python interpreter, type in commands at will. Examples: >>> print 'Hello world' Hello world 16
  • 17. Python Code Execution Pythons traditional runtime execution model: source code you type is translated to byte code, which is then run by the Python Virtual Machine. Your code is automatically compiled, but then it is interpreted. Source code extension is .py Byte code extension is .pyc (compiled python code) 17
  • 19. Math Try typing this into Code: >>> print 3 + 12 15 >>> print 12 3 9 >>> print 9 + 5 15 + 12 11 Operators: add: + subtract: - Note: dont type the arrows >>> ! 19
  • 20. Math Rule: If you want Python to answer in floats, you have to talk to it in floats. More operators: divide: / multiply: * >>> print 3 * 12 36 >>> print 12 / 3 4 >>> print 11 / 3 3 >>> print 12.0 / 3.0 4.0 >>> print 11.0 / 3.0 3.66 20
  • 21. Math Practice: >>> print 2 < 3 True >>> print 2 <= 2 False >>> print 3 > 2 True >>> print 2 != 3 True >>> print False < True True 21
  • 23. Strings Examples: Try typing one without quotes: Whats the result? >>> Its a beautiful day! >>> Goodbye, cruel world. >>> Aggies >>> Aggies >>> Rice fight, never die! >>> 3 + 2 23
  • 24. Strings String operators: concatenation: + multiplication: * Try concatenating: Try multiplying: >>> print Hello + + world! >>> print HAHA * 250 24
  • 26. Variable >>>headmaster=Dumbledore >>>print headmaster Dumbledore Create a Variable: Assigning a New Value: >>>headmaster=Hardcastle >>>print headmaster Hardcastle 26
  • 27. DATA TYPES IN PYTHON
  • 28. 28 Data Type: Python has many native data types. Here are the important ones: Booleans are either True or False. Numbers can be integers (1 and 2), floats (1.1 and 1.2), fractions (1/2 and 2/3), or even complex numbers. Strings are sequences of Unicode characters, e.g. an HTML document. Bytes and byte arrays, e.g. a JPEG image file. Lists are ordered sequences of values. Tuples are ordered, immutable sequences of values. Sets are unordered bags of values.
  • 29. Example: 29 String Whoop! Integer 42 Float 3.14159 List [John, Paul, George, Ringo] Python can tell us about types using the type() function: >>> print type(Whoop!) <type str>
  • 31. 31 List: The list is a most versatile Data type available in Python which can be written as a list of comma-separated values (items) between square brackets. Important thing about a list is that items in a list need not be of the same type. Example: list1 = ['physics', 'chemistry', 1997, 2000]; list2 = [1, 2, 3, 4, 5 ];
  • 32. 32 SN Function with Description 1 cmp(list1, list2) Compares elements of both lists. 2 len(list) Gives the total length of the list. 3 max(list) Returns item from the list with max value. 4 min(list) Returns item from the list with min value. 5 list(seq) Converts a tuple into list.
  • 33. List: a sequence of objects >>> Beatles = [John, Paul, George, Ringo] >>> grades = [82, 93, 67, 99, 100] Guess what this will output: >>> type(Beatles) >>> type(grades) 33
  • 34. Lists Index: Where an item is in the list >>> Beatles = [John, Paul, George, Ringo] >>> Beatles[0] John [John, Paul, George, Ringo] 0 1 2 3 Python always starts at zero! 34
  • 36. 36 Tuples: A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. The differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use parentheses, whereas lists use square brackets. Example: tup2 = (1, 2, 3, 4, 5 ); tup3 = ("a", "b", "c", "d); Accessing Values: print "tup2[1:5]: Output: tup2[1:5]: [2, 3, 4, 5]
  • 37. 37 Built-in Tuple Functions Python includes the following tuple functions SN Function with Description 1 cmp(tuple1, tuple2) Compares elements of both tuples. 2 len(tuple) Gives the total length of the tuple. 3 max(tuple) Returns item from the tuple with max value. 4 min(tuple) Returns item from the tuple with min value. 5 tuple(seq) Converts a list into tuple.
  • 39. 39 Loop Type Description while loop Repeats a statement or group of statements while a given condition is TRUE. It tests the condition before executing the loop body. for loop Executes a sequence of statements multiple times and abbreviates the code that manages the loop variable. nested loops You can use one or more loop inside any another while, for or do..while loop.
  • 40. 40 Statement Description if statements An if statement consists of a boolean expression followed by one or more statements. if...else statements An if statement can be followed by an optional else statement, which executes when the boolean expression is FALSE. nested if statements You can use one if or else if statement inside another if or else if statement(s).
  • 41. 41 I believe the trial has shown conclusively that it is both possible and desirable to use Python as the principal teaching language: o It is Free (as in both cost and source code). o It is trivial to install on a Windows PC allowing students to take their interest further. For many the hurdle of installing a Pascal or C compiler on a Windows machine is either too expensive or too complicated; o It is a flexible tool that allows both the teaching of traditional procedural programming and modern OOP; It can be used to teach a large number of transferable skills; o It is a real-world programming language that can be and is used in academia and the commercial world; o It appears to be quicker to learn and, in combination with its many libraries, this offers the possibility of more rapid student development allowing the course to be made more challenging and varied; o and most importantly, its clean syntax offers increased understanding and enjoyment for students;
  • 42. 42