Search for notes by fellow students, in your own course and all over the country.

Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.

My Basket

You have nothing in your shopping cart yet.

Title: Python Seminar PPT
Description: This is all about Python.

Document Preview

Extracts from the notes are below, to see the PDF you'll receive please use the links above


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
...

• So, Python is programming language as well as scripting
language
...
e
...
A
compilation is expected)
scripting language is nothing
• A "program" in general, is a
but a type of programming
sequence of instructions
language in which we can
written so that a computer
can perform certain task
...

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 Python’s Flying
Circus’, this is a famous TV show in Netherlands
• Named after Monty Python
• Open sourced from the beginning

5

Python’s Benevolent Dictator For Life
“Python is an experiment in how
much freedom programmers need
...

- 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
...

Moreover, doing these things in the Bourne shell
wouldn't work for a variety of reasons
...
For instance:
• Google makes extensive use of Python in its web search
system, and employs Python’s creator
...

• ESRI uses Python as an end-user customization tool for its
popular GIS mapping products
...


...
g
...


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
...
org/downloads/
- from the above link download latest version of
python IDE and install, recent version is 3
...
1 but
most of them uses version 2
...
7 only

13

• After installing the
Python Ver#2
...
7, go to
start menu then click on
python 2
...

• Examples:
>>> print 'Hello world'
Hello world

16

Python Code Execution
• Python’s traditional runtime execution model: source code
you type is translated to byte code, which is then run by the
Python Virtual Machine
...


Source 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: don’t type the arrows >>> !
19

Math
Rule: If you want Python to answer in floats, you have to
talk to it in floats
...
0 / 3
...
0 / 3
...
0
3
...

>>> 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
Create a Variable:
>>>head aster= Du
>>>print headmaster
Du ledore

ledore

Assigning a New Value:
>>>head aster= Hardcastle
>>>print headmaster
Hardcastle

26

DATA TYPES IN PYTHON

Data Type:
Python has many native data types
...

Numbers can be integers (1 and 2), floats (1
...
2), fractions
(1/2 and 2/3), or even complex numbers
...
g
...

Bytes and byte arrays, e
...
a JPEG image file
...

Tuples are ordered, immutable sequences of values
...

28

Example:

String
Integer
Float
List

“Whoop!”
42
3
...
Important thing about a
list is that items in a list need not be of the same type
...


2

len(list) Gives the total length of the list
...


4

min(list) Returns item from the list with min value
...

32

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

Tuples:
A tuple is a sequence of immutable Python objects
...
The differences between tuples and
lists are, the tuples cannot be changed unlike lists and tuples
use parentheses, whereas lists use square brackets
...


2

len(tuple) Gives the total length of the tuple
...


4

min(tuple) Returns item from the tuple with min value
...


37

LOOPS & CONDITIONAL
STATEMENTS

38

Loop Type

Description

while loop

Repeats a statement or group of statements
while a given condition is TRUE
...


for loop

Executes a sequence of statements multiple
times and abbreviates the code that
manages the loop variable
...
while loop
...


if
...


nested if statements

You can use one if or else if statement inside
another if or else if statement(s)
...

o It is trivial to install on a Windows PC allowing students to take
their interest further
Title: Python Seminar PPT
Description: This is all about Python.