What is Python ?
Python is a simple, easy to learn, powerful, high level and object-
oriented programming language.
Python is an interpreted scripting language also. Guido Van Rossum
is known as the founder of python programming.
Introduction to Python
It covers the topics such as python programming, features, history,
versions, how to install, example, how to execute, variables,
keywords, identifiers, literals, operators and comments.
Copied -Prof. Maulik Borsaniya
Control Statement
The control statement in python covers if
statement, for loop, while loop, do while loop,
break statement, continue statement and pass
statement.
Python Strings
The string chapter in python provides the full
functionality to work on strings such as accessing
string, applying string operators, details of slice
notation, applying different functions etc.
Copied -Prof. Maulik Borsaniya
Python Tuples
A sequence of immutable objects is known as tuple, it covers accessing
tuple, adding tuple, replicating tuple, updating tuple etc.
Python Dictionary
The python dictionary provides details about dictionary operations.
Python Functions
It provides a list of python functions with its implementations.
Python Files I/O
How to write data into file and read data from file in python?
Python Modules
What is python module? What are the usage of modules?
Python Exceptions
It explains the errors and exceptions in python.
Copied -Prof. Maulik Borsaniya
• Python Introduction
• Python is a general purpose, dynamic, high level and interpreted
programming language. It supports Object Oriented programming
approach to develop applications. It is simple and easy to learn
and provides lots of high-level data structures.
• Python is easy to learn yet powerful and versatile scripting
language which makes it attractive for Application Development.
• Python's syntax and dynamic typing with its interpreted nature,
makes it an ideal language for scripting and rapid application
development.
• Python supports multiple programming pattern, including object
oriented, imperative and functional or procedural programming
styles.
Copied -Prof. Maulik Borsaniya
Python is not intended to work on special area such as
web programming. That is why it is known
as multipurpose because it can be used with web,
enterprise, 3D CAD etc.
We don't need to use data types to declare variable
because it is dynamically typed so we can write a=10 to
assign an integer value in an integer variable.
Python makes the development and
debugging fast because there is no compilation step
included in python development and edit-test-debug
cycle is very fast.
Copied -Prof. Maulik Borsaniya
Python Features
1) Easy to Learn and Use
Python is easy to learn and use. It is developer-friendly and high level programming
language.
2) Expressive Language
Python language is more expressive means that it is more understandable and readable.
3) Interpreted Language
Python is an interpreted language i.e. interpreter executes the code line by line at a time.
This makes debugging easy and thus suitable for beginners.
4) Cross-platform Language
Python can run equally on different platforms such as Windows, Linux, Unix and Macintosh
etc. So, we can say that Python is a portable language.
5) Free and Open Source
Python language is freely available at offical web address.The source-code is also available.
Therefore it is open source.
Copied -Prof. Maulik Borsaniya
6) Object-Oriented Language
Python supports object oriented language and concepts of classes
and objects come into existence.
7)Extensible
It implies that other languages such as C/C++ can be used to compile
the code and thus it can be used further in our python code.
8) Large Standard Library
Python has a large and broad library and provides rich set of module
and functions for rapid application development.
9) GUI Programming Support
Graphical user interfaces can be developed using Python.
10) Integrated
It can be easily integrated with languages like C, C++, JAVA etc.Copied -Prof. Maulik Borsaniya
Python History
Python laid its foundation in the late 1980s.
The implementation of Python was started in the December 1989 by Guido Van
Rossum at CWI in Netherland.
In February 1991, van Rossum published the code (labeled version 0.9.0) to
alt.sources.
In 1994, Python 1.0 was released with new features like: lambda, map, filter, and
reduce.
Python 2.0 added new features like: list comprehensions, garbage collection
system.
On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was
designed to rectify fundamental flaw of the language.
ABC programming language is said to be the predecessor of Python language
which was capable of Exception Handling and interfacing with Amoeba OperatingCopied -Prof. Maulik Borsaniya
Python Version
Copied -Prof. Maulik Borsaniya
Copied -Prof. Maulik Borsaniya
Python Application Area
1) Web Applications
2) Desktop GUI Applications
3) Software Development
4) Scientific and Numeric
5) Business Applications
6) Console Based Application
7) Audio or Video based Applications
8) 3D CAD Applications
9) Enterprise Applications
10) Applications for Images
Copied -Prof. Maulik Borsaniya
Simple Demo Program
• print("hello world by python!")
Execute this example by using following
command.
Python hello.py
• OR
>>> a="Welcome To Python"
>>> print a
Welcome To Python
Copied -Prof. Maulik Borsaniya
S
Simple Variable
Declaration
Copied -Prof. Maulik Borsaniya
Variable Declaration
x=5……………..(1)
X=y=z=50…………….(2)
a,b,c=5,10,15……………..(3)
Copied -Prof. Maulik Borsaniya
Tokens
• Tokens can be defined as a punctuator mark,
reserved words and each individual word in a
statement.
• Token is the smallest unit inside the given
program.
• There are following tokens in Python:
• Keywords.
• Identifiers.
• Literals.
• Operators.
Copied -Prof. Maulik Borsaniya
Tuples
Tuple is another form of collection where different type
of data can be stored.
It is similar to list where data is separated by commas.
Only the difference is that list uses square bracket and
tuple uses parenthesis.
Tuples are enclosed in parenthesis and cannot be
changed.
Copied -Prof. Maulik Borsaniya
>>> tuple=('rahul',100,60.4,'deepak')
>>> tuple1=('sanjay',10)
>>> tuple ('rahul', 100, 60.4, 'deepak')
>>> tuple[2:] (60.4, 'deepak')
>>> tuple1[0] 'sanjay'
>>> tuple+tuple1 ('rahul', 100, 60.4, 'deepak', 'sanjay', 10)
Copied -Prof. Maulik Borsaniya
Dictionary
Dictionary is a collection which works on a key-value pair.
It works like an associated array where no two keys can be same.
Dictionaries are enclosed by curly braces ({}) and values can be
retrieved by square bracket([]).
>>> dictionary={'name':'charlie','id':100,'dept':'it'}
>>> dictionary {'dept': 'it', 'name': 'charlie', 'id': 100}
>>> dictionary.keys()
['dept', 'name', 'id']
>>> dictionary.values()
['it', 'charlie', 100]
Copied -Prof. Maulik Borsaniya
Python Keywords
Copied -Prof. Maulik Borsaniya
List
List contain items of different data types. Lists are mutable i.e.,
modifiable.
The values stored in List are separated by commas(,) and enclosed
within a square brackets([]). We can store different type of data in a
List.
Value stored in a List can be retrieved using the slice operator([] and
[:]).
The plus sign (+) is the list concatenation and asterisk(*) is the
repetition operator.
Copied -Prof. Maulik Borsaniya
>>> list=[‘Maulik',678,20.4,‘Ravi']
>>> list1=[456,‘Kalpesh']
list ['aman', 678, 20.4, 'saurav
>>> list+list1
Copied -Prof. Maulik Borsaniya
Operator
Operators are particular symbols that are used to perform operations on
operands. It returns result that can be used in application.
Arithmetic Operators.
Relational Operators.
Assignment Operators.
Logical Operators.
Membership Operators.
Identity Operators.
Bitwise Operators.
Copied -Prof. Maulik Borsaniya
Copied -Prof. Maulik Borsaniya
Copied -Prof. Maulik Borsaniya
Conditional Statement
Copied -Prof. Maulik Borsaniya
year=2000
if year%4==0:
print "Year is Leap"
else:
print "Year is not Leap"
Copied -Prof. Maulik Borsaniya

More Related Content

PPTX
Python presentation by Monu Sharma
PPTX
Python ppt
PPTX
Python programming introduction
PPTX
Chapter 8 getting started with python
PPTX
Python Programming Language
PPTX
Python Tutorial Part 1
PPTX
Python basics
PPT
Introduction to Python
Python presentation by Monu Sharma
Python ppt
Python programming introduction
Chapter 8 getting started with python
Python Programming Language
Python Tutorial Part 1
Python basics
Introduction to Python

What's hot (20)

PPTX
Python - An Introduction
PPTX
Introduction to-python
PPTX
Python Functions
PPTX
Beginning Python Programming
PPTX
Fundamentals of Python Programming
PPTX
Python | What is Python | History of Python | Python Tutorial
PPTX
Chapter 9 python fundamentals
PPSX
Modules and packages in python
PDF
Python Programming Language | Python Classes | Python Tutorial | Python Train...
PPT
Introduction to Python
PPT
Python Programming Language
PPTX
Python Exception Handling
PPTX
Looping statement in python
PPTX
Python and its Applications
PPTX
Introduction to the basics of Python programming (part 1)
PDF
Introduction to python programming
PDF
Python exception handling
PPTX
Python: Modules and Packages
PDF
Python final ppt
PPTX
Introduction to Basics of Python
Python - An Introduction
Introduction to-python
Python Functions
Beginning Python Programming
Fundamentals of Python Programming
Python | What is Python | History of Python | Python Tutorial
Chapter 9 python fundamentals
Modules and packages in python
Python Programming Language | Python Classes | Python Tutorial | Python Train...
Introduction to Python
Python Programming Language
Python Exception Handling
Looping statement in python
Python and its Applications
Introduction to the basics of Python programming (part 1)
Introduction to python programming
Python exception handling
Python: Modules and Packages
Python final ppt
Introduction to Basics of Python
Ad

Similar to Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA (20)

PPTX
pengenalan python apa itu python untuk apa.pptx
PDF
COMPUTER 8 Grade 8 - Intro to Python.pdf
PPTX
Presentation on python
PDF
Introduction of Python
PPTX
Python Seminar PPT
PPTX
Python
PDF
python-160403194316.pdf
PPTX
Introduction to Python Programming for beginners
PPTX
1. python programming
PPTX
Python.pptx
PPTX
Python Programming.pptx
PPTX
cupdf.com_python-seminar-ppt.pptx.........
PDF
Introduction To Python For Beginners
PPTX
Introduction to Python Programming Language
PDF
introduction of python in data science
PDF
Introduction to Python
PDF
summer t.pdf
PPTX
Python unit 2 is added. Has python related programming content
PPTX
Python Programming-1.pptx of python by computer
PPTX
Python Introduction
pengenalan python apa itu python untuk apa.pptx
COMPUTER 8 Grade 8 - Intro to Python.pdf
Presentation on python
Introduction of Python
Python Seminar PPT
Python
python-160403194316.pdf
Introduction to Python Programming for beginners
1. python programming
Python.pptx
Python Programming.pptx
cupdf.com_python-seminar-ppt.pptx.........
Introduction To Python For Beginners
Introduction to Python Programming Language
introduction of python in data science
Introduction to Python
summer t.pdf
Python unit 2 is added. Has python related programming content
Python Programming-1.pptx of python by computer
Python Introduction
Ad

More from Maulik Borsaniya (7)

PPTX
Dragon fruit-nutrition-facts
PPTX
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
PPTX
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
PPTX
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PPTX
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
PDF
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PPTX
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...
Dragon fruit-nutrition-facts
Chapter 5 - THREADING & REGULAR exp - MAULIK BORSANIYA
PYTHON -Chapter 5 NETWORK - MAULIK BORSANIYA
PYTHON - EXTRA Chapter GUI - MAULIK BORSANIYA
PYTHON-Chapter 4-Plotting and Data Science PyLab - MAULIK BORSANIYA
PYTHON-Chapter 3-Classes and Object-oriented Programming: MAULIK BORSANIYA
PYTHON -Chapter 2 - Functions, Exception, Modules and Files -MAULIK BOR...

Recently uploaded (20)

PDF
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
PDF
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
PPTX
Information-Technology-in-Human-Society.pptx
PPTX
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
PPTX
maintenance powerrpoint for adaprive and preventive
PPTX
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
PDF
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
PDF
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
PPTX
Report in SIP_Distance_Learning_Technology_Impact.pptx
PDF
Intravenous drug administration application for pediatric patients via augmen...
PDF
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
PDF
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
PPTX
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
PDF
Introduction to c language from lecture slides
PDF
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
PDF
Ebook - The Future of AI A Comprehensive Guide.pdf
PDF
Human Computer Interaction Miterm Lesson
PPTX
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
PDF
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
PDF
Child-friendly e-learning for artificial intelligence education in Indonesia:...
EGCB_Solar_Project_Presentation_and Finalcial Analysis.pdf
CCUS-as-the-Missing-Link-to-Net-Zero_AksCurious.pdf
Information-Technology-in-Human-Society.pptx
From XAI to XEE through Influence and Provenance.Controlling model fairness o...
maintenance powerrpoint for adaprive and preventive
Rise of the Digital Control Grid Zeee Media and Hope and Tivon FTWProject.com
FASHION-DRIVEN TEXTILES AS A CRYSTAL OF A NEW STREAM FOR STAKEHOLDER CAPITALI...
Be ready for tomorrow’s needs with a longer-lasting, higher-performing PC
Report in SIP_Distance_Learning_Technology_Impact.pptx
Intravenous drug administration application for pediatric patients via augmen...
【AI論文解説】高速・高品質な生成を実現するFlow Map Models(Part 1~3)
Slides World Game (s) Great Redesign Eco Economic Epochs.pdf
AQUEEL MUSHTAQUE FAKIH COMPUTER CENTER .
Introduction to c language from lecture slides
Uncertainty-aware contextual multi-armed bandits for recommendations in e-com...
Ebook - The Future of AI A Comprehensive Guide.pdf
Human Computer Interaction Miterm Lesson
Slides World Game (s) Great Redesign Eco Economic Epochs.pptx
The Digital Engine Room: Unlocking APAC’s Economic and Digital Potential thro...
Child-friendly e-learning for artificial intelligence education in Indonesia:...

Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA

  • 1. What is Python ? Python is a simple, easy to learn, powerful, high level and object- oriented programming language. Python is an interpreted scripting language also. Guido Van Rossum is known as the founder of python programming. Introduction to Python It covers the topics such as python programming, features, history, versions, how to install, example, how to execute, variables, keywords, identifiers, literals, operators and comments. Copied -Prof. Maulik Borsaniya
  • 2. Control Statement The control statement in python covers if statement, for loop, while loop, do while loop, break statement, continue statement and pass statement. Python Strings The string chapter in python provides the full functionality to work on strings such as accessing string, applying string operators, details of slice notation, applying different functions etc. Copied -Prof. Maulik Borsaniya
  • 3. Python Tuples A sequence of immutable objects is known as tuple, it covers accessing tuple, adding tuple, replicating tuple, updating tuple etc. Python Dictionary The python dictionary provides details about dictionary operations. Python Functions It provides a list of python functions with its implementations. Python Files I/O How to write data into file and read data from file in python? Python Modules What is python module? What are the usage of modules? Python Exceptions It explains the errors and exceptions in python. Copied -Prof. Maulik Borsaniya
  • 4. • Python Introduction • Python is a general purpose, dynamic, high level and interpreted programming language. It supports Object Oriented programming approach to develop applications. It is simple and easy to learn and provides lots of high-level data structures. • Python is easy to learn yet powerful and versatile scripting language which makes it attractive for Application Development. • Python's syntax and dynamic typing with its interpreted nature, makes it an ideal language for scripting and rapid application development. • Python supports multiple programming pattern, including object oriented, imperative and functional or procedural programming styles. Copied -Prof. Maulik Borsaniya
  • 5. Python is not intended to work on special area such as web programming. That is why it is known as multipurpose because it can be used with web, enterprise, 3D CAD etc. We don't need to use data types to declare variable because it is dynamically typed so we can write a=10 to assign an integer value in an integer variable. Python makes the development and debugging fast because there is no compilation step included in python development and edit-test-debug cycle is very fast. Copied -Prof. Maulik Borsaniya
  • 6. Python Features 1) Easy to Learn and Use Python is easy to learn and use. It is developer-friendly and high level programming language. 2) Expressive Language Python language is more expressive means that it is more understandable and readable. 3) Interpreted Language Python is an interpreted language i.e. interpreter executes the code line by line at a time. This makes debugging easy and thus suitable for beginners. 4) Cross-platform Language Python can run equally on different platforms such as Windows, Linux, Unix and Macintosh etc. So, we can say that Python is a portable language. 5) Free and Open Source Python language is freely available at offical web address.The source-code is also available. Therefore it is open source. Copied -Prof. Maulik Borsaniya
  • 7. 6) Object-Oriented Language Python supports object oriented language and concepts of classes and objects come into existence. 7)Extensible It implies that other languages such as C/C++ can be used to compile the code and thus it can be used further in our python code. 8) Large Standard Library Python has a large and broad library and provides rich set of module and functions for rapid application development. 9) GUI Programming Support Graphical user interfaces can be developed using Python. 10) Integrated It can be easily integrated with languages like C, C++, JAVA etc.Copied -Prof. Maulik Borsaniya
  • 8. Python History Python laid its foundation in the late 1980s. The implementation of Python was started in the December 1989 by Guido Van Rossum at CWI in Netherland. In February 1991, van Rossum published the code (labeled version 0.9.0) to alt.sources. In 1994, Python 1.0 was released with new features like: lambda, map, filter, and reduce. Python 2.0 added new features like: list comprehensions, garbage collection system. On December 3, 2008, Python 3.0 (also called "Py3K") was released. It was designed to rectify fundamental flaw of the language. ABC programming language is said to be the predecessor of Python language which was capable of Exception Handling and interfacing with Amoeba OperatingCopied -Prof. Maulik Borsaniya
  • 9. Python Version Copied -Prof. Maulik Borsaniya
  • 10. Copied -Prof. Maulik Borsaniya
  • 11. Python Application Area 1) Web Applications 2) Desktop GUI Applications 3) Software Development 4) Scientific and Numeric 5) Business Applications 6) Console Based Application 7) Audio or Video based Applications 8) 3D CAD Applications 9) Enterprise Applications 10) Applications for Images Copied -Prof. Maulik Borsaniya
  • 12. Simple Demo Program • print("hello world by python!") Execute this example by using following command. Python hello.py • OR >>> a="Welcome To Python" >>> print a Welcome To Python Copied -Prof. Maulik Borsaniya
  • 15. Tokens • Tokens can be defined as a punctuator mark, reserved words and each individual word in a statement. • Token is the smallest unit inside the given program. • There are following tokens in Python: • Keywords. • Identifiers. • Literals. • Operators. Copied -Prof. Maulik Borsaniya
  • 16. Tuples Tuple is another form of collection where different type of data can be stored. It is similar to list where data is separated by commas. Only the difference is that list uses square bracket and tuple uses parenthesis. Tuples are enclosed in parenthesis and cannot be changed. Copied -Prof. Maulik Borsaniya
  • 17. >>> tuple=('rahul',100,60.4,'deepak') >>> tuple1=('sanjay',10) >>> tuple ('rahul', 100, 60.4, 'deepak') >>> tuple[2:] (60.4, 'deepak') >>> tuple1[0] 'sanjay' >>> tuple+tuple1 ('rahul', 100, 60.4, 'deepak', 'sanjay', 10) Copied -Prof. Maulik Borsaniya
  • 18. Dictionary Dictionary is a collection which works on a key-value pair. It works like an associated array where no two keys can be same. Dictionaries are enclosed by curly braces ({}) and values can be retrieved by square bracket([]). >>> dictionary={'name':'charlie','id':100,'dept':'it'} >>> dictionary {'dept': 'it', 'name': 'charlie', 'id': 100} >>> dictionary.keys() ['dept', 'name', 'id'] >>> dictionary.values() ['it', 'charlie', 100] Copied -Prof. Maulik Borsaniya
  • 19. Python Keywords Copied -Prof. Maulik Borsaniya
  • 20. List List contain items of different data types. Lists are mutable i.e., modifiable. The values stored in List are separated by commas(,) and enclosed within a square brackets([]). We can store different type of data in a List. Value stored in a List can be retrieved using the slice operator([] and [:]). The plus sign (+) is the list concatenation and asterisk(*) is the repetition operator. Copied -Prof. Maulik Borsaniya
  • 21. >>> list=[‘Maulik',678,20.4,‘Ravi'] >>> list1=[456,‘Kalpesh'] list ['aman', 678, 20.4, 'saurav >>> list+list1 Copied -Prof. Maulik Borsaniya
  • 22. Operator Operators are particular symbols that are used to perform operations on operands. It returns result that can be used in application. Arithmetic Operators. Relational Operators. Assignment Operators. Logical Operators. Membership Operators. Identity Operators. Bitwise Operators. Copied -Prof. Maulik Borsaniya
  • 23. Copied -Prof. Maulik Borsaniya
  • 24. Copied -Prof. Maulik Borsaniya
  • 26. year=2000 if year%4==0: print "Year is Leap" else: print "Year is not Leap" Copied -Prof. Maulik Borsaniya