SlideShare une entreprise Scribd logo
1  sur  17
GOVERNMENT ENGINEERING COLLEGE
BHARATPUR
INDUSTRIAL TRAINING
2020-21
SUBMITTED BY:
MONISHA GOYAL
18EELCS010
SUBMITTED TO:
ANKIT SIR
 Python is a general purpose programming language that is often applied in
scripting roles.
 Python is also called as Interpreted language
 Python supports multiple programming paradigms including imperative, procedural
, functional and object oriented programming style.
 Python can be used for • System programming • Graphical User Interface
Programming • Internet Scripting • Component Integration • Database
Programming • Gaming, Images, XML , Robot and more .
 Python interpreters are available for installation on many operating systems,
allowing Python code execution on a wide variety of systems. Eg- IDLE
INTRODUCTION
KEYWORDS IN PYTHON
KEYWORDS
CLASS
PRIVATE VARIABLE
STRONGLY PRIVATE VARIABLE
SPECIAL PURPOSE
if, while
Complex, Exception
_aadharnum, _accountnum
__mobilenum, __loginid
__add__, __init__
Higher level programming languages like python provides a predefined
set of keywords using which a program is coded.
• Numeric Any representation of data which has numeric value.
Python identifies three types:-
1. INTEGER Positive and negative whole numbers. Examples: 1234, -2 etc.
2. FLOAT Real numbers with a floating point representation Examples: -
55.550
3.COMPLEX NUMBERS A number with a real and imaginary component is
represented as a + bj in Python where a and b are floats and
j = √-1. Examples: 4+6j.
DATATYPES IN PYTHON
• BOOLEAN: Any representation of data which has two values
denoted by True and False.
• SEQUENCE: An ordered collection of similar or different data
types. The built-in Sequence data types in python are:
1. STRING: A collection of one or more characters put in single,
double or triple quotes. Examples: ‘Hello’, "Hello",
"'Hello'", """Hello""“.
2. LIST: An ordered collection of one or more data items, not
necessarily of same type, put in square brackets. Examples:
[1,"Ravi",75.50, True].
3. TUPLE: Similar to list but he contents of a tuple cannot be modified – it is
immutable - after the tuple is created. Examples: (1,"Ravi", 75.50, True).
• DICTIONARY An unordered collection of data in key:value pair
form. Collection of such pairs is enclosed in curly brackets.
Example:
{1:"Superman", 2:"Wonder Woman", 3:"Thor", 4: "Hulk", 5:"Black
Widow“}
PROGRAMMING IN PYTHON
INTERACTIVE MODE:-Invoking the interpreter without passing a
script file as a parameter brings up the following prompt −
type the following text at the Python prompt and press the Enter −
this produces the following result −
Interactive mode is not suitable for automated processes. So we use scripting mode.
SCRIPTING MODE: Instead of executing one statement at a time we write all the
statement in a text file with .py extension. This script is commonly known as a python
program which can be executed through command line or from run menu of IDLE.
Advantages:
• Easily insert update and delete statements.
• Code or functions from a script can be inserted.
• Automate and schedule.
MATH OPERATOR IN PYTHON
>>> print 3 + 12
15
>>> print 12 – 3
9
>>> print 9 + 5 – 15 + 12
11
Operators: add: +
subtract: -
Math Rule: If you want Python to answer in floats, you have to talk to it in floats.
More operators: divide: /
multiply: *
>>> print 3 * 12
36
>>> print 12.0 / 3.0
4.0
STRINGS IN PYTHON
Strings operators:
 Concatenation: + Adds values on either side of the operator
Try concatenating:
: >>> print “Hello” + “ “ + “world!”
Hello world
 Multiplying: * Creates new strings, concatenating multiple copies of the
same string
Try multiplying
>>> print “HAHA” * 250
MODULE IN PYTHON:
 A module allows you to logically organize your Python code. Grouping related code
into a module makes the code easier to understand and use. A module is a Python
object with arbitrarily named attributes that you can bind and reference.
 Simply, a module is a file consisting of Python code. A module can define
functions, classes and variables. A module can also include runnable code.
The Import Statement:
When the interpreter encounters an import statement, it imports the module if the
module is present in the search path.
When the above code is executed, it produces the following result −
OBJECT ORIENTED PROGRAMMING:
 Python is a multi-paradigm programming language. It supports different
programming approaches.
 One of the popular approaches to solve a programming problem is by
creating objects. This is known as Object-Oriented Programming
(OOP).
 An object has two characteristics:
• attributes
• Behavior
Let's take an example:A parrot is can be an object,as it has the
following properties:
• name, age, color as attributes
• singing, dancing as behavior
 The concept of OOP in Python focuses on creating reusable code.
CONNECTING TO SQLITE DATABASE
 MySQLdb is an interface for connecting to a MySQL database server from Python
 After creating a database in mysql, we need to connect it to the python code.we
follow the following steps for connectivity to the database:
STUDENT MANAGEMENT SYSYTEM USING
PYTHON

Contenu connexe

Tendances

Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An IntroductionSwarit Wadhe
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonMaheshPandit16
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of PythonElewayte
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming LanguageTahani Al-Manie
 
Introduction to python 3
Introduction to python 3Introduction to python 3
Introduction to python 3Youhei Sakurai
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming pptismailmrribi
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python ProgrammingKamal Acharya
 
For Loops and Nesting in Python
For Loops and Nesting in PythonFor Loops and Nesting in Python
For Loops and Nesting in Pythonprimeteacher32
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptxBharathYusha1
 

Tendances (20)

Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Programming with Python
Programming with PythonProgramming with Python
Programming with Python
 
Python ppt
Python pptPython ppt
Python ppt
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
 
Python basics
Python basicsPython basics
Python basics
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming Language
 
Introduction to python 3
Introduction to python 3Introduction to python 3
Introduction to python 3
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
 
Introduction to Python Basics Programming
Introduction to Python Basics ProgrammingIntroduction to Python Basics Programming
Introduction to Python Basics Programming
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Python GUI
Python GUIPython GUI
Python GUI
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 
For Loops and Nesting in Python
For Loops and Nesting in PythonFor Loops and Nesting in Python
For Loops and Nesting in Python
 
Python Tutorial Part 2
Python Tutorial Part 2Python Tutorial Part 2
Python Tutorial Part 2
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
 
Python ppt.pptx
Python ppt.pptxPython ppt.pptx
Python ppt.pptx
 
Introduction to Python Programming language.pptx
Introduction to Python Programming language.pptxIntroduction to Python Programming language.pptx
Introduction to Python Programming language.pptx
 

Similaire à Programming

Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdfsamiwaris2
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh MalothBhavsingh Maloth
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxlemonchoos
 
Tutorial on-python-programming
Tutorial on-python-programmingTutorial on-python-programming
Tutorial on-python-programmingChetan Giridhar
 
Python for katana
Python for katanaPython for katana
Python for katanakedar nath
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unitmichaelaaron25322
 
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdfPy-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdfshetoooelshitany74
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonMohammed Rafi
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of pythonBijuAugustian
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxRohitKumar639388
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsAndrew McNicol
 
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
 

Similaire à Programming (20)

Python (3).pdf
Python (3).pdfPython (3).pdf
Python (3).pdf
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Python intro
Python introPython intro
Python intro
 
Python_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptxPython_Introduction_Good_PPT.pptx
Python_Introduction_Good_PPT.pptx
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Report om 3
Report om 3Report om 3
Report om 3
 
Tutorial on-python-programming
Tutorial on-python-programmingTutorial on-python-programming
Tutorial on-python-programming
 
Python programming
Python programmingPython programming
Python programming
 
Python for katana
Python for katanaPython for katana
Python for katana
 
Python programming language introduction unit
Python programming language introduction unitPython programming language introduction unit
Python programming language introduction unit
 
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdfPy-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
Py-Slides- easuajsjsjejejjwlqpqpqpp1.pdf
 
Python PPT.pptx
Python PPT.pptxPython PPT.pptx
Python PPT.pptx
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
INTERNSHIP REPORT.docx
 INTERNSHIP REPORT.docx INTERNSHIP REPORT.docx
INTERNSHIP REPORT.docx
 
Python fundamentals
Python fundamentalsPython fundamentals
Python fundamentals
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security Professionals
 
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
 

Dernier

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)simmis5
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 

Dernier (20)

MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)Java Programming :Event Handling(Types of Events)
Java Programming :Event Handling(Types of Events)
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 

Programming

  • 1. GOVERNMENT ENGINEERING COLLEGE BHARATPUR INDUSTRIAL TRAINING 2020-21 SUBMITTED BY: MONISHA GOYAL 18EELCS010 SUBMITTED TO: ANKIT SIR
  • 2.
  • 3.  Python is a general purpose programming language that is often applied in scripting roles.  Python is also called as Interpreted language  Python supports multiple programming paradigms including imperative, procedural , functional and object oriented programming style.  Python can be used for • System programming • Graphical User Interface Programming • Internet Scripting • Component Integration • Database Programming • Gaming, Images, XML , Robot and more .  Python interpreters are available for installation on many operating systems, allowing Python code execution on a wide variety of systems. Eg- IDLE INTRODUCTION
  • 4. KEYWORDS IN PYTHON KEYWORDS CLASS PRIVATE VARIABLE STRONGLY PRIVATE VARIABLE SPECIAL PURPOSE if, while Complex, Exception _aadharnum, _accountnum __mobilenum, __loginid __add__, __init__ Higher level programming languages like python provides a predefined set of keywords using which a program is coded.
  • 5.
  • 6. • Numeric Any representation of data which has numeric value. Python identifies three types:- 1. INTEGER Positive and negative whole numbers. Examples: 1234, -2 etc. 2. FLOAT Real numbers with a floating point representation Examples: - 55.550 3.COMPLEX NUMBERS A number with a real and imaginary component is represented as a + bj in Python where a and b are floats and j = √-1. Examples: 4+6j. DATATYPES IN PYTHON
  • 7. • BOOLEAN: Any representation of data which has two values denoted by True and False. • SEQUENCE: An ordered collection of similar or different data types. The built-in Sequence data types in python are: 1. STRING: A collection of one or more characters put in single, double or triple quotes. Examples: ‘Hello’, "Hello", "'Hello'", """Hello""“. 2. LIST: An ordered collection of one or more data items, not necessarily of same type, put in square brackets. Examples: [1,"Ravi",75.50, True]. 3. TUPLE: Similar to list but he contents of a tuple cannot be modified – it is immutable - after the tuple is created. Examples: (1,"Ravi", 75.50, True).
  • 8. • DICTIONARY An unordered collection of data in key:value pair form. Collection of such pairs is enclosed in curly brackets. Example: {1:"Superman", 2:"Wonder Woman", 3:"Thor", 4: "Hulk", 5:"Black Widow“}
  • 9.
  • 10. PROGRAMMING IN PYTHON INTERACTIVE MODE:-Invoking the interpreter without passing a script file as a parameter brings up the following prompt − type the following text at the Python prompt and press the Enter − this produces the following result − Interactive mode is not suitable for automated processes. So we use scripting mode.
  • 11. SCRIPTING MODE: Instead of executing one statement at a time we write all the statement in a text file with .py extension. This script is commonly known as a python program which can be executed through command line or from run menu of IDLE. Advantages: • Easily insert update and delete statements. • Code or functions from a script can be inserted. • Automate and schedule.
  • 12. MATH OPERATOR IN PYTHON >>> print 3 + 12 15 >>> print 12 – 3 9 >>> print 9 + 5 – 15 + 12 11 Operators: add: + subtract: - Math Rule: If you want Python to answer in floats, you have to talk to it in floats. More operators: divide: / multiply: * >>> print 3 * 12 36 >>> print 12.0 / 3.0 4.0
  • 13. STRINGS IN PYTHON Strings operators:  Concatenation: + Adds values on either side of the operator Try concatenating: : >>> print “Hello” + “ “ + “world!” Hello world  Multiplying: * Creates new strings, concatenating multiple copies of the same string Try multiplying >>> print “HAHA” * 250
  • 14. MODULE IN PYTHON:  A module allows you to logically organize your Python code. Grouping related code into a module makes the code easier to understand and use. A module is a Python object with arbitrarily named attributes that you can bind and reference.  Simply, a module is a file consisting of Python code. A module can define functions, classes and variables. A module can also include runnable code. The Import Statement: When the interpreter encounters an import statement, it imports the module if the module is present in the search path. When the above code is executed, it produces the following result −
  • 15. OBJECT ORIENTED PROGRAMMING:  Python is a multi-paradigm programming language. It supports different programming approaches.  One of the popular approaches to solve a programming problem is by creating objects. This is known as Object-Oriented Programming (OOP).  An object has two characteristics: • attributes • Behavior Let's take an example:A parrot is can be an object,as it has the following properties: • name, age, color as attributes • singing, dancing as behavior  The concept of OOP in Python focuses on creating reusable code.
  • 16. CONNECTING TO SQLITE DATABASE  MySQLdb is an interface for connecting to a MySQL database server from Python  After creating a database in mysql, we need to connect it to the python code.we follow the following steps for connectivity to the database: