SlideShare uma empresa Scribd logo
1 de 99
Python3 Programming
Language
10/2/2020
Presentation Outline
10/2/2020
Python Overview
Python Data Types
Python Control Structures
Python Inputoutput
Python Functions
Python File Handling
Python Exception Handling
Python Modules
Python Classes
Python vs. Java Examples
Python Useful Tools
Who uses Python?
Python Overview
10/2/2020
What is Python?
10/2/2020
Python is a high-level programming language which is:
 Interpreted: Python is processed at runtime by the interpreter.
 Interactive: You can use a Python prompt and interact with the interpreter
directly to write your programs.
 Object-Oriented: Python supports Object-Oriented technique of
programming.
 Beginner’s Language: Python is a great
language for the beginner-level programmers and supports
the development of a wide range of applications.
History of Python
10/2/2020
 Python was conceptualized by Guido Van Rossum in the late
1980s.
 Rossum published the first version of Python code (0.9.0) in
February 1991 at the CWI (Centrum Wiskunde & Informatica)
in the Netherlands , Amsterdam.
 Python is derived from ABC programming language, which is a
general-purpose programming language that had been
developed at the CWI.
 Rossum chose the name "Python", since he was a big fan of
Monty Python's Flying Circus.
 Python is now maintained by a core development team at the
institute, although Rossum still holds a vital role in directing its
progress.
Python Versions
10/2/2020
Release dates for the major and minor
versions:
Python 1.0 - January 1994
 Python 1.5 - December 31, 1997
 Python 1.6 - September 5, 2000
Python 2.0 - October 16, 2000
 Python 2.1 - April 17, 2001
 Python 2.2 - December 21, 2001
 Python 2.3 - July 29, 2003
 Python 2.4 - November 30, 2004
 Python 2.5 - September 19, 2006
 Python 2.6 - October 1, 2008
 Python 2.7 - July 3, 2010
Python Versions
10/2/2020
Release dates for the major and minor
versions:
Python 3.0 - December 3, 2008
 Python 3.1 - June 27, 2009
 Python 3.2 - February 20, 2011
 Python 3.3 - September 29, 2012
 Python 3.4 - March 16, 2014
 Python 3.5 - September 13, 2015
Python Features
10/2/2020
 Easy to learn, easy to read and easy to maintain.
 Portable:It can run on various hardware platforms and has the
same interface on all platforms.
 Extendable: You can add low-level modules to the Python interpreter.
 Scalable: Python provides a good structure and support for large
programs.
 Python has support for an interactive mode of testing and debugging.
 Python has a broad standard library cross-platform.
 Everythingin Python is an object:variables,functions, even code.
Every object has an ID, a type, and a value.
More Features ..
10/2/2020
 Python provides interfaces to all major commercial databases.
 Python supports functional and structured programming methods as
well as
OOP.
 Python provides very high-level dynamic data types and supports
dynamic
type checking.
 Python supports GUI applications
 Python supports automatic garbage collection.
 Python can be easily integrated with C, C++, and Java.
Python Useful
Tools
10/2/2020
Useful Tools
10/2/2020
 Python IDEs
•Vim
•Eclipse with
PyDev
•Sublime Text
•Emacs
•Komodo Edit
•PyCharm
Useful Tools
10/2/2020
 Python Web
Frameworks
•Django
•Flask
•Pylons
•Pyramid
•TurboGears
•Web2py
What can I do with Python…?
 System programming
 Graphical User Interface Programming
 Internet Scripting
 Component Integration
 Database Programming
 Gaming, Images, XML , Robot and more
10/2/2020
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 Python’s 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/2/2020
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
10/2/2020
Who Uses
Python?
10/2/2020
Organizations Use Python
10/2/2020
• Web Development :Google, Yahoo
• Games :Battlefield 2, Crystal Space
• Graphics :Walt Disney Feature Animation, Blender
3D
• Science :National Weather Service, NASA, Applied
Maths
• Software Development :Nokia, Red Hat, IBM
• Education :University of California-Irvine,
SchoolTool
• Government :The USA Central Intelligence Agency
(CIA)
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.
10/2/2020
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 10/2/2020
Installation of Python inWindows
• Go to Download Python page on the official site
(https://www.python.org/downloads/) and click Download
Python
3.6.5 (You may see different version name)
• When the download is completed, double-click the file and
follow the instructions to install it.
• When Python is installed, a program called IDLE is also
installed along with it. It provides graphical user interface to
work with Python.
• Open IDLE, Write the following code below and press enter.
print("Hello, World!")
• To create a file in IDLE, go to File > New Window (Shortcut:
Ctrl+N).
• Write Python code and save (Shortcut: Ctrl+S) with .py file
extension like: hello.py or your-first-program.py
print("Hello, World!")
• Go to Run > Run module (Shortcut: F5) and you can see the
output.
Python
Syntax
10/2/2020
First PythonProgram
Second Program
Basic Syntax
10/2/2020
 Indentation is used in Python to delimit blocks. The number of
spaces is variable, but all statements within
the same block must be
indented the same amount.
 The header line for compound statements, such as if, while,
def, and
class should be terminated with a colon ( : )
 The semicolon ( ; ) is optional at the end of statement.
 Printing to the Screen:
 Reading Keyboard Input:
 Comments
•Single line:
•Multiple lines:
 Python files have extension
.py
Error
!
Few Important Things toRemember
• To represent a statement in Python, newline (enter) is used.
• Use of semicolon at the end of the statement is optional
(unlike languages like C/C++)
• In fact, it's recommended to omit semicolon at the end of
the statement in Python
• Instead of curly braces { }, indentations are used to represent a
block
Python Keywords
• Keywords are the reserved words(can not be used as a
identifier) in Python
• Are case sensitive
Python Identifiers
• Name given to entities like class, functions, variables etc. in
Python
• Rules for writing identifiers
• Can be a combination of letters in lowercase (a to z) or uppercase (A
to Z) or digits (0 to 9) or an underscore (_)
• myClass, var_1 and print_this_to_screen, all are valid examples
• Cannot start with a digit
• 1variable is invalid, but variable1 is perfectly fine
• Keywords cannot be used as identifiers
• Cannot use special symbols like !, @, #, $, % etc. in our identifier
• Can be of any length.
Variables
10/2/2020
 Python is dynamically typed. You do not
need to declare variables!
 The declaration happens automatically
when
you assign a value to a variable.
 Variables can change type, simply by
assigning them a new value of a different
type.
 Python allows you to assign a single value to
several variables simultaneously.
 You can also assign multiple objects to
multiple variables.
Things to careabout
• Python is a case-sensitive language.
• Variable and variable are not the same.
• Multiple words can be separated using an
underscore, this_is_a_long_variable
• Can also use camel-case style of writing, i.e., capitalize
every first letter of the word except the initial word without
any spaces
• camelCaseExample
Python Statement
• Instructions that a Python interpreter can execute are
called statements.
• Two types
• Single line statement:
• For example, a = 1 is an assignment statement
• Multiline statement:
• In Python, end of a statement is marked by a newline character.
• So, how to make multiline statement?
• Technique1:
• make a statement extend over multiple lines with the line
continuation character ().
• For example:
a = 1 + 2 + 3 + 
4 + 5 + 6 + 
7 + 8 + 9
• Technique2:
• make a statement extend over multiple lines with the
parentheses ( )
• For example:
a=(1+2+3+
4+5+6+
7+8+9)
• Technique3:
• make a statement extend over multiple lines with the brackets [ ] and
braces {
}.
• For example:
colors = ['red',
'blue',
'green']
• We could also put multiple statements in a single line
using semicolons, as follows
a=1;b=2;c=3
Python Indentation
• Most of the programming languages like C, C++, Java use
braces { } to define a block of code
• Python uses indentation
• A code block (body of a function, loop etc.) starts with
indentation and ends with the first un-indented line
Error due to incorrectindentation
Python Data
Types
10/2/2020
DataTypes
• In python data types are classes and variables are instance
(object) of these classes
• Different types of data types in python are:
• Python numbers
• Python lists
• Python tuples
• Python strings
• Python sets
• Python dictionary
Literals Collection
Numbers
10/2/2020
 Numbers are Immutable objects in Python that cannot change their values.
 There are three built-in data types for numbers in Python3:
• Integer (int)
• Floating-point numbers (float)
• Complex numbers: <real part> + <imaginary part>j (not used much in Python
programming)
 Common Number Functions
Function Description
int(x) to convert x to an integer
float(x) to convert x to a floating-point number
abs(x) The absolute value of x
cmp(x,y) -1 if x < y, 0 if x == y, or 1 if x > y
exp(x) The exponential of x: ex
log(x) The natural logarithm of x, for x> 0
pow(x,y) The value of x**y
sqrt(x) The square root of x for x > 0
Python Numbers
Strings
10/2/2020
 Python Strings are Immutable objects that cannot change their
values.
 You can update an existing string by (re)assigning a variable to another string.
 Python does not support a character type; these are treated as strings of length
one.
 Python accepts single ('), double (") and triple (''' or """) quotes to denote string
literals.
 String indexes starting at 0 in the beginning of the string and working their way
from -1
at the end.
Python Strings
• use single quotes or double quotes to represent strings.
• Multi-line strings can be denoted using triple quotes, ''' or
""".
• Example:
s = "This is a
string" s = '''a
multiline
string’’’
• Strings are also immutable.
Strings
10/2/2020
 String Formatting
 Common String Operators
Assume string variable a holds 'Hello' and variable b holds
'Python’Operator Description Example
+ Concatenation - Adds values on either side of the operator a + b will give
HelloPython
* Repetition - Creates new strings, concatenating multiple
copies of
the same string
a*2 will give HelloHello
[ ] Slice - Gives the character from the given index a[1] will give
e a[-1] will
give o
[ : ] Range Slice - Gives the characters from the given range a[1:4] will give ell
in Membership - Returns true if a character exists in the given
string
‘H’ in a will give True
Strings
10/2/2020
 Common String
MethodsMethod Description
str.count(sub,
beg=
0,end=len(str))
Counts how many times sub occurs in string or in a substring of
string if starting index beg and ending index end are given.
str.isalpha() Returns True if string has at least 1 character and all
characters are alphanumeric and False otherwise.
str.isdigit() Returns True if string contains only digits and False otherwise.
str.lower() Converts all uppercase letters in string to lowercase.
str.upper() Converts lowercase letters in string to uppercase.
str.replace(old, new) Replaces all occurrences of old in string with new.
str.split(str=‘ ’) Splits string according to delimiter str (space if not
provided) and returns list of substrings.
str.strip() Removes all leading and trailing whitespace of string.
str.title() Returns "titlecased" version of string.
 Common String
Functions
str(x) :to convert x to a string
len(string):gives the total length of the
string
Lists
10/2/2020
 A list in Python is an ordered group of items or elements, and these list
elements don't have to be of the same type.
 Python Lists are mutable objects that can change their values.
 A list contains items separated by commas and enclosed within square brackets.
 List indexes like strings starting at 0 in the beginning of the list and working their
way from -1 at the end.
 Similar to strings, Lists operations include slicing ([ ] and [:]) , concatenation
(+),
repetition (*), and membership (in).
 This example shows how to access, update and delete list elements:
 access
 slice
 update
 delete
Python List
• Ordered sequence of items
• Can contain heterogeneous data
• Syntax:
• Items separated by commas are enclosed within
brackets [ ]
• Example: a= [1,2.2,'python']
Extracting elements from thelist
• Note: Lists are mutable, meaning, value of elements of a list
can be altered.
Lists
10/2/2020
 Lists can have sublists as elements and these sublists may contain other
sublists
as well.
 Common List
Functions Function Description
cmp(list1, list2) Compares elements of both lists.
len(list) Gives the total length of the list.
max(list) Returns item from the list with max value.
min(list) Returns item from the list with min value.
list(tuple) Converts a tuple into list.
Lists
10/2/2020
 Common List
MethodsMethod Description
list.append(obj) Appends object obj to list
list.insert(index,
obj)
Inserts object obj into list at offset index
list.count(obj) Returns count of how many times obj occurs in
list
list.index(obj) Returns the lowest index in list that obj appears
list.remove(obj) Removes object obj from list
list.reverse() Reverses objects of list in place
list.sort() Sorts objects of list in place
 List Comprehensions
Each list comprehension consists of an expression followed by a for
clause.
 List comprehension
Tuples
10/2/2020
 Python Tuples are Immutableobjects that cannot be changedonce theyhave
been
created.
 A tuple contains items separated by commas and enclosed in parentheses instead
of square brackets.

access
 No update
 You can update an existing tuple by (re)assigning a variable to another tuple.
 Tuples are faster than lists and protect your data against accidental changes to
these data.
 The rules for tuple indices are the same as for lists and they have the same
operations,
functions as well.
 To write a tuple containing a single value, you have to include a comma, even
though there is only one value. e.g. t = (3, )
PythonTuple
• Same as list but immutable.
• Used to write-protect the data
• Syntax:
• Items separated by commas are enclosed within
brackets ( )
• Example:
• t = (5,'program', 1+3j)
Dictionary
10/2/2020
 Python's dictionaries are kind of hash table type which consist of key-
value pairs
of unordered elements.
• Keys : must be immutable data types ,usually numbers or strings.
• Values : can be any arbitrary Python object.
 Python Dictionaries are mutable objects that can change their values.
 A dictionary is enclosed by curly braces ({ }), the items are separated by
commas, and each key is separated from its value by a colon (:).
 Dictionary’s values can be assigned and accessed using square braces
([]) with a key to obtain its value.
Dictionary
10/2/2020
 This example shows how to access, update and delete dictionary
elements:
 The
output:
Dictionary
10/2/2020
 Common Dictionary Functions
• cmp(dict1, dict2) : compares elements of both dict.
• len(dict) : gives the total number of (key, value) pairs in the
dictionary.
 Common Dictionary Methods
Method Description
dict.keys() Returns list of dict's keys
dict.values() Returns list of dict's values
dict.items() Returns a list of dict's (key, value) tuple pairs
dict.get(key,
default=None)
For key, returns value or default if key not in dict
dict.has_key(key) Returns True if key in dict, False otherwise
dict.update(dict2) Adds dict2's key-values pairs to dict
dict.clear() Removes all elements of dict
Python Set
• Unordered collection of unique items
• defined by values separated by comma inside
braces { }
• Set have unique values. They eliminate
duplicates.
• Example:
• Since, set are unordered collection, indexing has no
meaning.
• Hence the slicing operator [] does not work.
• Example:
Python Control
Structures
10/2/2020
Conditionals
10/2/2020
 In Python, True and False are Boolean objects of class 'bool' and they are
immutable.
 Python assumes any non-zero and non-null values as True, otherwise it is
False value.
 Python does not provide switch or case statements as in other languages.
 Syntax:
if Statement if..else Statement if..elif..else Statement
 Example:
Conditionals
10/2/2020
 Using the conditional expression
Another type of conditional structure in Python, which is very convenient and easy
to read.

Loops
10/2/2020
 The For
Loop
 The while
Loop
Loops
10/2/2020
Loop Control Statements
 break :Terminates the
loop
statement and transfers execution to the
statementimmediately following the
loop.
 continue:Causes the loop to skip the remainder of its body and immediately
retest its condition prior to reiterating.
 pass:Used when a statement is required syntactically but you do not want
any
command or code to execute.
Python
Functions
10/2/2020
Functions
10/2/2020
 Function
Syntax
 Function Arguments
You can call a function by using any of the following types of
arguments:
• Required arguments: the arguments passed to the function in
correct positional order.
• Keyword arguments: the function call identifies the arguments
by the parameter names.
• Default arguments: the argument has a default value in the
function declaration used when the value is not provided in the
function call.
Functions
10/2/2020
• Variable-length arguments: This used when you need to process unspecified
additional
arguments. An asterisk (*) is placed before the variable name in the function
declaration.
Python File
Handling
10/2/2020
File Handling
10/2/2020
 File
opening
fileObject = open(file_name [, access_mode][,
buffering])
Common access modes:
• “r” opens a file for reading only.
• “w” opens a file for writing only. Overwrites the file if the file exists.
Otherwise, it creates a new file.
• “a” opens a file for appending. If the file does not exist, it creates a
new file for writing.
 Closing a
file
fileObject.close
()
The close() method flushes any unwritten information and closes the file
object.
File Handling
10/2/2020
 Reading a
file
fileObject.read([count])
• The read() method reads the whole file at once.
• The readline() method reads one line each time from
the file.
• The readlines() method reads all lines from the file in a
list.
 Writing in a
file
fileObject.write(string)
The write() method writes any string to an open
file.
Python Exception
Handling
10/2/2020
Exception Handling
10/2/2020
 Common Exceptions in Python:
NameError - TypeError - IndexError - KeyError -
Exception
 Exception Handling Syntax:
 An empty except statement can catch any exception.
 finally clause: always executed before finishing try
statements.

Python
Modules
10/2/2020
Modules
10/2/2020
 A module is a file consisting of Python code that can define functions, classes and
variables.
 A module allows you to organize your code by grouping related code which
makes the
code easier to understand and use.
 You can use any Python source file as a module by executing an import
statement
 Python's from statement lets you import specific attributes from a module into the
current namespace.
 import * statement can be used to import all names from a module into the
current namespace
Python Object
Oriented
10/2/2020
Python Classes
10/2/2020
Output

 Class variable
 Class
constructor
Python Classes
10/2/2020
 Built-in class functions
• getattr(obj, name[, default]) : to access the attribute of object.
• hasattr(obj,name) : to check if an attribute exists or not.
• setattr(obj,name,value) : to set an attribute. If attribute does not exist,
then it would be created.
• delattr(obj, name) : to delete an attribute.
 Data Hiding You need to name attributes with a double underscore
prefix, and those
attributes then are not be directly visible to outsiders.
Class Inheritance
10/2/2020
Python vs. Java
Code Examples
10/2/2020
Python vs. Java
10/2/2020
 Hello
World
Java Pytho
n
 String
Operations
Java Pytho
n
Python vs. Java
10/2/2020
 Collectio
ns
Java
Pytho
n
Python vs. Java
10/2/2020
 Class and
Inheritance
Java
Pytho
n

References
10/2/2020
1 Python-course.eu, 'Python3 Tutorial: Python Online Course', 2015. [Online]. Available:
http://www.python-course.eu/python3_course.php.
2www.tutorialspoint.com, 'Python tutorial', 2015. [Online].
Available: http://www.tutorialspoint.com/python/index.htm.
3 Wikipedia, 'History of Python', 2015. [Online]. Available:
https://en.wikipedia.org/wiki/History_of_Python#Version_release_dates.
4Docs.python.org, 'What's New In Python 3.0’, 2015. [Online].
Available: https://docs.python.org/3/whatsnew/3.0.html.
5Sebastianraschka.com, 'Python 2.7.x and Python 3.x key differences', 2015. [Online].
Available: http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html.
6Programcreek.com, 'Java vs. Python: Why Python can be more productive?', 2015.
[Online]. Available: http://www.programcreek.com/2012/04/java-vs-python-why-python-
can-be-more- productive/.
ByTahaniAlmanie |CSCI5828
References
10/2/2020
7Stsdas.stsci.edu, 'A Quick Tour of Python', 2015. [Online].
Available: http://stsdas.stsci.edu/pyraf/python_quick_tour.html.
8Lynda.com - A LinkedIn Company, 'Python 3 Essential Training | Lynda.com Training',
2015. [Online]. Available: http://www.lynda.com/Python-3-tutorials/essential-
training/62226-2.html.
9Pymbook.readthedocs.org, 'Welcome to Python for you and me — Python for you
and me 0.3.alpha1 documentation', 2015. [Online]. Available:
http://pymbook.readthedocs.org/en/latest/index.html.
10 Code Geekz, '10 Best Python IDE for Developers | Code Geekz', 2014. [Online].
Available:
https://codegeekz.com/best-python-ide-for-developers/.
11K. Radhakrishnan, 'Top 10 Python Powered Web Frameworks For Developers',
Toppersworld.com, 2014. [Online]. Available: http://toppersworld.com/top-10-python-powered-
web- frameworks-for-developers/.
12Wiki.python.org, 'OrganizationsUsingPython - Python Wiki', 2015. [Online].
Available: https://wiki.python.org/moin/OrganizationsUsingPython. ByTahaniAlmanie |CSCI5828

Mais conteúdo relacionado

Mais procurados (20)

Python-00 | Introduction and installing
Python-00 | Introduction and installingPython-00 | Introduction and installing
Python-00 | Introduction and installing
 
Python programming
Python  programmingPython  programming
Python programming
 
Python by Rj
Python by RjPython by Rj
Python by Rj
 
Overview of python 2019
Overview of python 2019Overview of python 2019
Overview of python 2019
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python basic
Python basicPython basic
Python basic
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
 
Introduction to python
 Introduction to python Introduction to python
Introduction to python
 
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
 
Basics of python
Basics of pythonBasics of python
Basics of python
 
Python
PythonPython
Python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python basics
Python basicsPython basics
Python basics
 
How to download and install Python - lesson 2
How to download and install Python - lesson 2How to download and install Python - lesson 2
How to download and install Python - lesson 2
 
Get started python programming part 1
Get started python programming   part 1Get started python programming   part 1
Get started python programming part 1
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Introduction python
Introduction pythonIntroduction python
Introduction python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 

Semelhante a Python final presentation kirti ppt1

PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptxMaheShiva
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxcigogag569
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of pythonBijuAugustian
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHBhavsingh Maloth
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptxGnanesh12
 
IRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming LanguageIRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming LanguageIRJET Journal
 
python programming.pptx
python programming.pptxpython programming.pptx
python programming.pptxKaviya452563
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unitmichaelaaron25322
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfVaibhavKumarSinghkal
 
Session-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptxSession-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptxWajidAliHashmi2
 
introduction to Python (for beginners)
introduction to Python (for beginners)introduction to Python (for beginners)
introduction to Python (for beginners)guobichrng
 
Python for students step by step guidance
Python for students step by step guidancePython for students step by step guidance
Python for students step by step guidanceMantoshKumar79
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PuneEthan's Tech
 
Python_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfPython_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfVisionAcademyProfSac
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1Ahmet Bulut
 

Semelhante a Python final presentation kirti ppt1 (20)

python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
 
Python programming
Python programmingPython programming
Python programming
 
Cmpe202 01 Research
Cmpe202 01 ResearchCmpe202 01 Research
Cmpe202 01 Research
 
4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx4_Introduction to Python Programming.pptx
4_Introduction to Python Programming.pptx
 
Research paper on python by Rj
Research paper on python by RjResearch paper on python by Rj
Research paper on python by Rj
 
IRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming LanguageIRJET- Python: Simple though an Important Programming Language
IRJET- Python: Simple though an Important Programming Language
 
python programming.pptx
python programming.pptxpython programming.pptx
python programming.pptx
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Introduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdfIntroduction to Python Unit -1 Part .pdf
Introduction to Python Unit -1 Part .pdf
 
Session-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptxSession-1_Introduction to Python.pptx
Session-1_Introduction to Python.pptx
 
introduction to Python (for beginners)
introduction to Python (for beginners)introduction to Python (for beginners)
introduction to Python (for beginners)
 
Python for students step by step guidance
Python for students step by step guidancePython for students step by step guidance
Python for students step by step guidance
 
Python Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech PunePython Training in Pune - Ethans Tech Pune
Python Training in Pune - Ethans Tech Pune
 
Python_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdfPython_final_print_vison_academy_9822506209.pdf
Python_final_print_vison_academy_9822506209.pdf
 
Programming with Python: Week 1
Programming with Python: Week 1Programming with Python: Week 1
Programming with Python: Week 1
 

Mais de Kirti Verma

L-5 BCEProcess management.ppt
L-5 BCEProcess management.pptL-5 BCEProcess management.ppt
L-5 BCEProcess management.pptKirti Verma
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptKirti Verma
 
L-4 BCE Generations of Computers final.ppt
L-4 BCE Generations of Computers final.pptL-4 BCE Generations of Computers final.ppt
L-4 BCE Generations of Computers final.pptKirti Verma
 
L-1 BCE computer fundamentals final kirti.ppt
L-1 BCE computer fundamentals final kirti.pptL-1 BCE computer fundamentals final kirti.ppt
L-1 BCE computer fundamentals final kirti.pptKirti Verma
 
BCE L-4 Data Type In C++.ppt
BCE L-4 Data Type In C++.pptBCE L-4 Data Type In C++.ppt
BCE L-4 Data Type In C++.pptKirti Verma
 
BCE L-3 overview of C++.ppt
BCE L-3 overview of C++.pptBCE L-3 overview of C++.ppt
BCE L-3 overview of C++.pptKirti Verma
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptBCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptKirti Verma
 
BCE L-1 Programmimg languages.pptx
BCE L-1  Programmimg languages.pptxBCE L-1  Programmimg languages.pptx
BCE L-1 Programmimg languages.pptxKirti Verma
 
BCE L-1 networking fundamentals 111.pptx
BCE L-1  networking fundamentals 111.pptxBCE L-1  networking fundamentals 111.pptx
BCE L-1 networking fundamentals 111.pptxKirti Verma
 
BCE L-2 e commerce.pptx
BCE L-2 e commerce.pptxBCE L-2 e commerce.pptx
BCE L-2 e commerce.pptxKirti Verma
 
BCE L-3omputer security Basics.pptx
BCE L-3omputer security Basics.pptxBCE L-3omputer security Basics.pptx
BCE L-3omputer security Basics.pptxKirti Verma
 
L 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptxL 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptxKirti Verma
 
L 2 Introduction to Data science final kirti.pptx
L 2 Introduction to Data science final kirti.pptxL 2 Introduction to Data science final kirti.pptx
L 2 Introduction to Data science final kirti.pptxKirti Verma
 
Pandas Dataframe reading data Kirti final.pptx
Pandas Dataframe reading data  Kirti final.pptxPandas Dataframe reading data  Kirti final.pptx
Pandas Dataframe reading data Kirti final.pptxKirti Verma
 
L 8 introduction to machine learning final kirti.pptx
L 8 introduction to machine learning final kirti.pptxL 8 introduction to machine learning final kirti.pptx
L 8 introduction to machine learning final kirti.pptxKirti Verma
 
L 6.1 complete scikit libraray.pptx
L 6.1 complete scikit libraray.pptxL 6.1 complete scikit libraray.pptx
L 6.1 complete scikit libraray.pptxKirti Verma
 
L 7Complete Machine learning.pptx
L 7Complete Machine learning.pptxL 7Complete Machine learning.pptx
L 7Complete Machine learning.pptxKirti Verma
 
Introduction to python history and platforms
Introduction to python history and platformsIntroduction to python history and platforms
Introduction to python history and platformsKirti Verma
 
Informed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptxInformed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptxKirti Verma
 
Production System l 10.pptx
Production System l 10.pptxProduction System l 10.pptx
Production System l 10.pptxKirti Verma
 

Mais de Kirti Verma (20)

L-5 BCEProcess management.ppt
L-5 BCEProcess management.pptL-5 BCEProcess management.ppt
L-5 BCEProcess management.ppt
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.ppt
 
L-4 BCE Generations of Computers final.ppt
L-4 BCE Generations of Computers final.pptL-4 BCE Generations of Computers final.ppt
L-4 BCE Generations of Computers final.ppt
 
L-1 BCE computer fundamentals final kirti.ppt
L-1 BCE computer fundamentals final kirti.pptL-1 BCE computer fundamentals final kirti.ppt
L-1 BCE computer fundamentals final kirti.ppt
 
BCE L-4 Data Type In C++.ppt
BCE L-4 Data Type In C++.pptBCE L-4 Data Type In C++.ppt
BCE L-4 Data Type In C++.ppt
 
BCE L-3 overview of C++.ppt
BCE L-3 overview of C++.pptBCE L-3 overview of C++.ppt
BCE L-3 overview of C++.ppt
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptBCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
 
BCE L-1 Programmimg languages.pptx
BCE L-1  Programmimg languages.pptxBCE L-1  Programmimg languages.pptx
BCE L-1 Programmimg languages.pptx
 
BCE L-1 networking fundamentals 111.pptx
BCE L-1  networking fundamentals 111.pptxBCE L-1  networking fundamentals 111.pptx
BCE L-1 networking fundamentals 111.pptx
 
BCE L-2 e commerce.pptx
BCE L-2 e commerce.pptxBCE L-2 e commerce.pptx
BCE L-2 e commerce.pptx
 
BCE L-3omputer security Basics.pptx
BCE L-3omputer security Basics.pptxBCE L-3omputer security Basics.pptx
BCE L-3omputer security Basics.pptx
 
L 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptxL 5 Numpy final ppt kirti.pptx
L 5 Numpy final ppt kirti.pptx
 
L 2 Introduction to Data science final kirti.pptx
L 2 Introduction to Data science final kirti.pptxL 2 Introduction to Data science final kirti.pptx
L 2 Introduction to Data science final kirti.pptx
 
Pandas Dataframe reading data Kirti final.pptx
Pandas Dataframe reading data  Kirti final.pptxPandas Dataframe reading data  Kirti final.pptx
Pandas Dataframe reading data Kirti final.pptx
 
L 8 introduction to machine learning final kirti.pptx
L 8 introduction to machine learning final kirti.pptxL 8 introduction to machine learning final kirti.pptx
L 8 introduction to machine learning final kirti.pptx
 
L 6.1 complete scikit libraray.pptx
L 6.1 complete scikit libraray.pptxL 6.1 complete scikit libraray.pptx
L 6.1 complete scikit libraray.pptx
 
L 7Complete Machine learning.pptx
L 7Complete Machine learning.pptxL 7Complete Machine learning.pptx
L 7Complete Machine learning.pptx
 
Introduction to python history and platforms
Introduction to python history and platformsIntroduction to python history and platforms
Introduction to python history and platforms
 
Informed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptxInformed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptx
 
Production System l 10.pptx
Production System l 10.pptxProduction System l 10.pptx
Production System l 10.pptx
 

Último

CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfBalamuruganV28
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labsamber724300
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProRay Yuan Liu
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Romil Mishra
 
Substation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHSubstation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHbirinder2
 
tourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdftourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdfchess188chess188
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHSneha Padhiar
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSneha Padhiar
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfDrew Moseley
 
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...shreenathji26
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Coursebim.edu.pl
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organizationchnrketan
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxLina Kadam
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfalene1
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communicationpanditadesh123
 

Último (20)

CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdf
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labs
 
A brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision ProA brief look at visionOS - How to develop app on Apple's Vision Pro
A brief look at visionOS - How to develop app on Apple's Vision Pro
 
Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________Gravity concentration_MI20612MI_________
Gravity concentration_MI20612MI_________
 
Substation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRHSubstation Automation SCADA and Gateway Solutions by BRH
Substation Automation SCADA and Gateway Solutions by BRH
 
tourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdftourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdf
 
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACHTEST CASE GENERATION GENERATION BLOCK BOX APPROACH
TEST CASE GENERATION GENERATION BLOCK BOX APPROACH
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
Immutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdfImmutable Image-Based Operating Systems - EW2024.pdf
Immutable Image-Based Operating Systems - EW2024.pdf
 
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
Introduction to Artificial Intelligence: Intelligent Agents, State Space Sear...
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Course
 
priority interrupt computer organization
priority interrupt computer organizationpriority interrupt computer organization
priority interrupt computer organization
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
AntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptxAntColonyOptimizationManetNetworkAODV.pptx
AntColonyOptimizationManetNetworkAODV.pptx
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
multiple access in wireless communication
multiple access in wireless communicationmultiple access in wireless communication
multiple access in wireless communication
 

Python final presentation kirti ppt1

  • 2. Presentation Outline 10/2/2020 Python Overview Python Data Types Python Control Structures Python Inputoutput Python Functions Python File Handling Python Exception Handling Python Modules Python Classes Python vs. Java Examples Python Useful Tools Who uses Python?
  • 4. What is Python? 10/2/2020 Python is a high-level programming language which is:  Interpreted: Python is processed at runtime by the interpreter.  Interactive: You can use a Python prompt and interact with the interpreter directly to write your programs.  Object-Oriented: Python supports Object-Oriented technique of programming.  Beginner’s Language: Python is a great language for the beginner-level programmers and supports the development of a wide range of applications.
  • 5. History of Python 10/2/2020  Python was conceptualized by Guido Van Rossum in the late 1980s.  Rossum published the first version of Python code (0.9.0) in February 1991 at the CWI (Centrum Wiskunde & Informatica) in the Netherlands , Amsterdam.  Python is derived from ABC programming language, which is a general-purpose programming language that had been developed at the CWI.  Rossum chose the name "Python", since he was a big fan of Monty Python's Flying Circus.  Python is now maintained by a core development team at the institute, although Rossum still holds a vital role in directing its progress.
  • 6. Python Versions 10/2/2020 Release dates for the major and minor versions: Python 1.0 - January 1994  Python 1.5 - December 31, 1997  Python 1.6 - September 5, 2000 Python 2.0 - October 16, 2000  Python 2.1 - April 17, 2001  Python 2.2 - December 21, 2001  Python 2.3 - July 29, 2003  Python 2.4 - November 30, 2004  Python 2.5 - September 19, 2006  Python 2.6 - October 1, 2008  Python 2.7 - July 3, 2010
  • 7. Python Versions 10/2/2020 Release dates for the major and minor versions: Python 3.0 - December 3, 2008  Python 3.1 - June 27, 2009  Python 3.2 - February 20, 2011  Python 3.3 - September 29, 2012  Python 3.4 - March 16, 2014  Python 3.5 - September 13, 2015
  • 8. Python Features 10/2/2020  Easy to learn, easy to read and easy to maintain.  Portable:It can run on various hardware platforms and has the same interface on all platforms.  Extendable: You can add low-level modules to the Python interpreter.  Scalable: Python provides a good structure and support for large programs.  Python has support for an interactive mode of testing and debugging.  Python has a broad standard library cross-platform.  Everythingin Python is an object:variables,functions, even code. Every object has an ID, a type, and a value.
  • 9. More Features .. 10/2/2020  Python provides interfaces to all major commercial databases.  Python supports functional and structured programming methods as well as OOP.  Python provides very high-level dynamic data types and supports dynamic type checking.  Python supports GUI applications  Python supports automatic garbage collection.  Python can be easily integrated with C, C++, and Java.
  • 11. Useful Tools 10/2/2020  Python IDEs •Vim •Eclipse with PyDev •Sublime Text •Emacs •Komodo Edit •PyCharm
  • 12. Useful Tools 10/2/2020  Python Web Frameworks •Django •Flask •Pylons •Pyramid •TurboGears •Web2py
  • 13. What can I do with Python…?  System programming  Graphical User Interface Programming  Internet Scripting  Component Integration  Database Programming  Gaming, Images, XML , Robot and more 10/2/2020
  • 14. 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 Python’s 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/2/2020
  • 15. 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 10/2/2020
  • 17. Organizations Use Python 10/2/2020 • Web Development :Google, Yahoo • Games :Battlefield 2, Crystal Space • Graphics :Walt Disney Feature Animation, Blender 3D • Science :National Weather Service, NASA, Applied Maths • Software Development :Nokia, Red Hat, IBM • Education :University of California-Irvine, SchoolTool • Government :The USA Central Intelligence Agency (CIA)
  • 18. 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. 10/2/2020
  • 19. 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 10/2/2020
  • 20. Installation of Python inWindows • Go to Download Python page on the official site (https://www.python.org/downloads/) and click Download Python 3.6.5 (You may see different version name) • When the download is completed, double-click the file and follow the instructions to install it. • When Python is installed, a program called IDLE is also installed along with it. It provides graphical user interface to work with Python.
  • 21. • Open IDLE, Write the following code below and press enter. print("Hello, World!") • To create a file in IDLE, go to File > New Window (Shortcut: Ctrl+N). • Write Python code and save (Shortcut: Ctrl+S) with .py file extension like: hello.py or your-first-program.py print("Hello, World!") • Go to Run > Run module (Shortcut: F5) and you can see the output.
  • 24.
  • 26.
  • 27. Basic Syntax 10/2/2020  Indentation is used in Python to delimit blocks. The number of spaces is variable, but all statements within the same block must be indented the same amount.  The header line for compound statements, such as if, while, def, and class should be terminated with a colon ( : )  The semicolon ( ; ) is optional at the end of statement.  Printing to the Screen:  Reading Keyboard Input:  Comments •Single line: •Multiple lines:  Python files have extension .py Error !
  • 28. Few Important Things toRemember • To represent a statement in Python, newline (enter) is used. • Use of semicolon at the end of the statement is optional (unlike languages like C/C++) • In fact, it's recommended to omit semicolon at the end of the statement in Python • Instead of curly braces { }, indentations are used to represent a block
  • 29. Python Keywords • Keywords are the reserved words(can not be used as a identifier) in Python • Are case sensitive
  • 30. Python Identifiers • Name given to entities like class, functions, variables etc. in Python • Rules for writing identifiers • Can be a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore (_) • myClass, var_1 and print_this_to_screen, all are valid examples • Cannot start with a digit • 1variable is invalid, but variable1 is perfectly fine • Keywords cannot be used as identifiers • Cannot use special symbols like !, @, #, $, % etc. in our identifier • Can be of any length.
  • 31. Variables 10/2/2020  Python is dynamically typed. You do not need to declare variables!  The declaration happens automatically when you assign a value to a variable.  Variables can change type, simply by assigning them a new value of a different type.  Python allows you to assign a single value to several variables simultaneously.  You can also assign multiple objects to multiple variables.
  • 32. Things to careabout • Python is a case-sensitive language. • Variable and variable are not the same. • Multiple words can be separated using an underscore, this_is_a_long_variable • Can also use camel-case style of writing, i.e., capitalize every first letter of the word except the initial word without any spaces • camelCaseExample
  • 33. Python Statement • Instructions that a Python interpreter can execute are called statements. • Two types • Single line statement: • For example, a = 1 is an assignment statement • Multiline statement: • In Python, end of a statement is marked by a newline character. • So, how to make multiline statement?
  • 34. • Technique1: • make a statement extend over multiple lines with the line continuation character (). • For example: a = 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9
  • 35. • Technique2: • make a statement extend over multiple lines with the parentheses ( ) • For example: a=(1+2+3+ 4+5+6+ 7+8+9)
  • 36. • Technique3: • make a statement extend over multiple lines with the brackets [ ] and braces { }. • For example: colors = ['red', 'blue', 'green']
  • 37. • We could also put multiple statements in a single line using semicolons, as follows a=1;b=2;c=3
  • 38. Python Indentation • Most of the programming languages like C, C++, Java use braces { } to define a block of code • Python uses indentation • A code block (body of a function, loop etc.) starts with indentation and ends with the first un-indented line
  • 39.
  • 40.
  • 41. Error due to incorrectindentation
  • 43. DataTypes • In python data types are classes and variables are instance (object) of these classes • Different types of data types in python are: • Python numbers • Python lists • Python tuples • Python strings • Python sets • Python dictionary
  • 45.
  • 46. Numbers 10/2/2020  Numbers are Immutable objects in Python that cannot change their values.  There are three built-in data types for numbers in Python3: • Integer (int) • Floating-point numbers (float) • Complex numbers: <real part> + <imaginary part>j (not used much in Python programming)  Common Number Functions Function Description int(x) to convert x to an integer float(x) to convert x to a floating-point number abs(x) The absolute value of x cmp(x,y) -1 if x < y, 0 if x == y, or 1 if x > y exp(x) The exponential of x: ex log(x) The natural logarithm of x, for x> 0 pow(x,y) The value of x**y sqrt(x) The square root of x for x > 0
  • 48.
  • 49. Strings 10/2/2020  Python Strings are Immutable objects that cannot change their values.  You can update an existing string by (re)assigning a variable to another string.  Python does not support a character type; these are treated as strings of length one.  Python accepts single ('), double (") and triple (''' or """) quotes to denote string literals.  String indexes starting at 0 in the beginning of the string and working their way from -1 at the end.
  • 50. Python Strings • use single quotes or double quotes to represent strings. • Multi-line strings can be denoted using triple quotes, ''' or """. • Example: s = "This is a string" s = '''a multiline string’’’ • Strings are also immutable.
  • 51.
  • 52.
  • 53. Strings 10/2/2020  String Formatting  Common String Operators Assume string variable a holds 'Hello' and variable b holds 'Python’Operator Description Example + Concatenation - Adds values on either side of the operator a + b will give HelloPython * Repetition - Creates new strings, concatenating multiple copies of the same string a*2 will give HelloHello [ ] Slice - Gives the character from the given index a[1] will give e a[-1] will give o [ : ] Range Slice - Gives the characters from the given range a[1:4] will give ell in Membership - Returns true if a character exists in the given string ‘H’ in a will give True
  • 54. Strings 10/2/2020  Common String MethodsMethod Description str.count(sub, beg= 0,end=len(str)) Counts how many times sub occurs in string or in a substring of string if starting index beg and ending index end are given. str.isalpha() Returns True if string has at least 1 character and all characters are alphanumeric and False otherwise. str.isdigit() Returns True if string contains only digits and False otherwise. str.lower() Converts all uppercase letters in string to lowercase. str.upper() Converts lowercase letters in string to uppercase. str.replace(old, new) Replaces all occurrences of old in string with new. str.split(str=‘ ’) Splits string according to delimiter str (space if not provided) and returns list of substrings. str.strip() Removes all leading and trailing whitespace of string. str.title() Returns "titlecased" version of string.  Common String Functions str(x) :to convert x to a string len(string):gives the total length of the string
  • 55. Lists 10/2/2020  A list in Python is an ordered group of items or elements, and these list elements don't have to be of the same type.  Python Lists are mutable objects that can change their values.  A list contains items separated by commas and enclosed within square brackets.  List indexes like strings starting at 0 in the beginning of the list and working their way from -1 at the end.  Similar to strings, Lists operations include slicing ([ ] and [:]) , concatenation (+), repetition (*), and membership (in).  This example shows how to access, update and delete list elements:  access  slice  update  delete
  • 56. Python List • Ordered sequence of items • Can contain heterogeneous data • Syntax: • Items separated by commas are enclosed within brackets [ ] • Example: a= [1,2.2,'python']
  • 58.
  • 59. • Note: Lists are mutable, meaning, value of elements of a list can be altered.
  • 60. Lists 10/2/2020  Lists can have sublists as elements and these sublists may contain other sublists as well.  Common List Functions Function Description cmp(list1, list2) Compares elements of both lists. len(list) Gives the total length of the list. max(list) Returns item from the list with max value. min(list) Returns item from the list with min value. list(tuple) Converts a tuple into list.
  • 61. Lists 10/2/2020  Common List MethodsMethod Description list.append(obj) Appends object obj to list list.insert(index, obj) Inserts object obj into list at offset index list.count(obj) Returns count of how many times obj occurs in list list.index(obj) Returns the lowest index in list that obj appears list.remove(obj) Removes object obj from list list.reverse() Reverses objects of list in place list.sort() Sorts objects of list in place  List Comprehensions Each list comprehension consists of an expression followed by a for clause.  List comprehension
  • 62. Tuples 10/2/2020  Python Tuples are Immutableobjects that cannot be changedonce theyhave been created.  A tuple contains items separated by commas and enclosed in parentheses instead of square brackets.  access  No update  You can update an existing tuple by (re)assigning a variable to another tuple.  Tuples are faster than lists and protect your data against accidental changes to these data.  The rules for tuple indices are the same as for lists and they have the same operations, functions as well.  To write a tuple containing a single value, you have to include a comma, even though there is only one value. e.g. t = (3, )
  • 63. PythonTuple • Same as list but immutable. • Used to write-protect the data • Syntax: • Items separated by commas are enclosed within brackets ( ) • Example: • t = (5,'program', 1+3j)
  • 64.
  • 65.
  • 66.
  • 67.
  • 68. Dictionary 10/2/2020  Python's dictionaries are kind of hash table type which consist of key- value pairs of unordered elements. • Keys : must be immutable data types ,usually numbers or strings. • Values : can be any arbitrary Python object.  Python Dictionaries are mutable objects that can change their values.  A dictionary is enclosed by curly braces ({ }), the items are separated by commas, and each key is separated from its value by a colon (:).  Dictionary’s values can be assigned and accessed using square braces ([]) with a key to obtain its value.
  • 69. Dictionary 10/2/2020  This example shows how to access, update and delete dictionary elements:  The output:
  • 70. Dictionary 10/2/2020  Common Dictionary Functions • cmp(dict1, dict2) : compares elements of both dict. • len(dict) : gives the total number of (key, value) pairs in the dictionary.  Common Dictionary Methods Method Description dict.keys() Returns list of dict's keys dict.values() Returns list of dict's values dict.items() Returns a list of dict's (key, value) tuple pairs dict.get(key, default=None) For key, returns value or default if key not in dict dict.has_key(key) Returns True if key in dict, False otherwise dict.update(dict2) Adds dict2's key-values pairs to dict dict.clear() Removes all elements of dict
  • 71. Python Set • Unordered collection of unique items • defined by values separated by comma inside braces { }
  • 72.
  • 73. • Set have unique values. They eliminate duplicates. • Example:
  • 74. • Since, set are unordered collection, indexing has no meaning. • Hence the slicing operator [] does not work. • Example:
  • 76. Conditionals 10/2/2020  In Python, True and False are Boolean objects of class 'bool' and they are immutable.  Python assumes any non-zero and non-null values as True, otherwise it is False value.  Python does not provide switch or case statements as in other languages.  Syntax: if Statement if..else Statement if..elif..else Statement  Example:
  • 77. Conditionals 10/2/2020  Using the conditional expression Another type of conditional structure in Python, which is very convenient and easy to read. 
  • 79. Loops 10/2/2020 Loop Control Statements  break :Terminates the loop statement and transfers execution to the statementimmediately following the loop.  continue:Causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.  pass:Used when a statement is required syntactically but you do not want any command or code to execute.
  • 81. Functions 10/2/2020  Function Syntax  Function Arguments You can call a function by using any of the following types of arguments: • Required arguments: the arguments passed to the function in correct positional order. • Keyword arguments: the function call identifies the arguments by the parameter names. • Default arguments: the argument has a default value in the function declaration used when the value is not provided in the function call.
  • 82. Functions 10/2/2020 • Variable-length arguments: This used when you need to process unspecified additional arguments. An asterisk (*) is placed before the variable name in the function declaration.
  • 84. File Handling 10/2/2020  File opening fileObject = open(file_name [, access_mode][, buffering]) Common access modes: • “r” opens a file for reading only. • “w” opens a file for writing only. Overwrites the file if the file exists. Otherwise, it creates a new file. • “a” opens a file for appending. If the file does not exist, it creates a new file for writing.  Closing a file fileObject.close () The close() method flushes any unwritten information and closes the file object.
  • 85. File Handling 10/2/2020  Reading a file fileObject.read([count]) • The read() method reads the whole file at once. • The readline() method reads one line each time from the file. • The readlines() method reads all lines from the file in a list.  Writing in a file fileObject.write(string) The write() method writes any string to an open file.
  • 87. Exception Handling 10/2/2020  Common Exceptions in Python: NameError - TypeError - IndexError - KeyError - Exception  Exception Handling Syntax:  An empty except statement can catch any exception.  finally clause: always executed before finishing try statements. 
  • 89. Modules 10/2/2020  A module is a file consisting of Python code that can define functions, classes and variables.  A module allows you to organize your code by grouping related code which makes the code easier to understand and use.  You can use any Python source file as a module by executing an import statement  Python's from statement lets you import specific attributes from a module into the current namespace.  import * statement can be used to import all names from a module into the current namespace
  • 91. Python Classes 10/2/2020 Output   Class variable  Class constructor
  • 92. Python Classes 10/2/2020  Built-in class functions • getattr(obj, name[, default]) : to access the attribute of object. • hasattr(obj,name) : to check if an attribute exists or not. • setattr(obj,name,value) : to set an attribute. If attribute does not exist, then it would be created. • delattr(obj, name) : to delete an attribute.  Data Hiding You need to name attributes with a double underscore prefix, and those attributes then are not be directly visible to outsiders.
  • 94. Python vs. Java Code Examples 10/2/2020
  • 95. Python vs. Java 10/2/2020  Hello World Java Pytho n  String Operations Java Pytho n
  • 96. Python vs. Java 10/2/2020  Collectio ns Java Pytho n
  • 97. Python vs. Java 10/2/2020  Class and Inheritance Java Pytho n 
  • 98. References 10/2/2020 1 Python-course.eu, 'Python3 Tutorial: Python Online Course', 2015. [Online]. Available: http://www.python-course.eu/python3_course.php. 2www.tutorialspoint.com, 'Python tutorial', 2015. [Online]. Available: http://www.tutorialspoint.com/python/index.htm. 3 Wikipedia, 'History of Python', 2015. [Online]. Available: https://en.wikipedia.org/wiki/History_of_Python#Version_release_dates. 4Docs.python.org, 'What's New In Python 3.0’, 2015. [Online]. Available: https://docs.python.org/3/whatsnew/3.0.html. 5Sebastianraschka.com, 'Python 2.7.x and Python 3.x key differences', 2015. [Online]. Available: http://sebastianraschka.com/Articles/2014_python_2_3_key_diff.html. 6Programcreek.com, 'Java vs. Python: Why Python can be more productive?', 2015. [Online]. Available: http://www.programcreek.com/2012/04/java-vs-python-why-python- can-be-more- productive/. ByTahaniAlmanie |CSCI5828
  • 99. References 10/2/2020 7Stsdas.stsci.edu, 'A Quick Tour of Python', 2015. [Online]. Available: http://stsdas.stsci.edu/pyraf/python_quick_tour.html. 8Lynda.com - A LinkedIn Company, 'Python 3 Essential Training | Lynda.com Training', 2015. [Online]. Available: http://www.lynda.com/Python-3-tutorials/essential- training/62226-2.html. 9Pymbook.readthedocs.org, 'Welcome to Python for you and me — Python for you and me 0.3.alpha1 documentation', 2015. [Online]. Available: http://pymbook.readthedocs.org/en/latest/index.html. 10 Code Geekz, '10 Best Python IDE for Developers | Code Geekz', 2014. [Online]. Available: https://codegeekz.com/best-python-ide-for-developers/. 11K. Radhakrishnan, 'Top 10 Python Powered Web Frameworks For Developers', Toppersworld.com, 2014. [Online]. Available: http://toppersworld.com/top-10-python-powered- web- frameworks-for-developers/. 12Wiki.python.org, 'OrganizationsUsingPython - Python Wiki', 2015. [Online]. Available: https://wiki.python.org/moin/OrganizationsUsingPython. ByTahaniAlmanie |CSCI5828