SlideShare a Scribd company logo
1 of 30
Python Programming
Submitted By- Submitted To-
Rachit Bhargava Naveen Dadhich
16EVJEC014
Slide 1
Python Programming
• Introduction To Python
• Using Variables In Python
• Basics Of Programming Python
• Connecting To SQLite Database
• Developing a GUI with PyQT
Slide 2
Introduction To Python
• Python is a general purpose interpreted interactive object oriented and high level
programming language .
• It was first introduced in 1991 by Guido van Rossum, a Dutch computer programmer.
• The language places strong emphasis on code reliability and simplicity so that the
programmers can develop applications rapidly.
• Python is multiprogramming language, which allows user to code in several different
programming styles.
• Python is widely used for scripting in Game menu applications effectively.
• Most programs in Python require considerably less number of code to perform the same
task compared to other languages like C. So less programming errors and reduces the
development time needed also.
Slide 3
Installation Of Python
• To learn language first, we have to download the software which is Python Interpreter.
• To download Python Interpreter we go to the site https://www.python.org/downloads and
click on the suitable icon. The website appears as below
Slide 4
Data Types And Variables
Data Types are classification of data items
Slide 6
• Numeric – Any representation of data which has numeric value. Python
identifies three types of numbers- integers, float and complex number.
(a) Integer- Positive and negative whole numbers. Ex- 1234, -23 etc.
(b) Float- Real numbers with a floating point representation in which the fractional
component is denoted by a decimal or scientific notation. Ex- 55.55, -66.7
(c) Complex Number- A number with a real and imaginary component is represented as a+bj
in Python. Ex- 5+6j
• 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 Sequences
data types are – String, List, and Tuple.
Slide 7
(a) String- A collection of one or more characters put in single, double or triple
quotes. Ex- ‘Hello’, “Hello”
(b) List- An ordered collection of one or more data items, not necessarily of same type, put in
square brackets .Ex - [1,”Ravi”,75.50]
(c) Tuple- An ordered collection of one or more data items, not necessarily of same type put in
parentheses. Ex - (1, “Ravi”, 75.50)
• Dictionary- An ordered collection of data in key:value pair form. Collection of such pairs is
enclosed in curly brackets. Ex – {1:”Iron Man”, 2:”Thor”, 3:”Captain America”}
Slide 8
Variables
Variables are the name given to the data that we need to store and manipulate in our program.
For example, to store the age of the user, we can write a variable userAge and its is defined as
below.
userAge=0 or userAge=30
A variable can have short name. A variable start with a letter or the underscore character.
A variable cannot start with a number. A variable name can only contain alpha-numeric and
underscores(A-z, 0-9, _).
Slide 9
Basics Of Programming
Program- It is set of instruction given to computers to perform a task.
Computer Programming- It consists of two steps.
Slide 10
Operators In Python
• Arithmetic Operators- These operators are used to perform basic mathematic operations. Ex-
Addition x + y, Subtraction x – y, Multiplication x * y.
• Assignment Operators- It is use to assign the value to the variables. Ex – x=5, x=x+3.
• Comparison Operators- These operators compares the operands present on either side.
Ex- x>y, x==y. It will give either true or false.
• Logical Operators- These operators are python keywords that are used for joining two
Boolean expression. Types of logical operators are-
Slide 11
Conditional Statements
If Statement
It is one of the commonly used control flow statements. It allows the program to evaluate if
certain condition is met. It is used for decision making.
Slide 12
Else Statement
The else statement is usually used when we have to judge one statement on the
basis of other. If one condition goes wrong, then there should be another condition that
should justify the statement or logic.
Slide 13
Loops In Python
If the program close redirected towards any of earlier statement in the program than it is
known as a loop. Types Of Loops-
(a) While Loop
(b) For loop
Slide 14
While Loop
In python, while loop is used to execute a block of statement until a given condition
is satisfied. And when the condition become false, the line immediately after the loop in
program is executed. Syntax-
Slide 15
For Loop
It is a control flow statement for specifying iteration, which allows code to be executed
repeatedly. It starts with for keyword.
Slide 16
Connecting to SQLite Database
Database- It is a collection of related data. It is a special type of computer file. Database is
centralized program independent and organized collection of data which removes data
redundancy and ensure data integrity.
Database Model-
(a) Network Model
(b) Hierarchical Model
(c) Relational Database Model
Relational Database
Data organized in one or more table called Relations. Each table represent one entity.
Slide 17
Relational Database Management
System
It is software for creating and managing database. It makes possible for us to read, create,
update, delete data in a database. RDBMS software uses special language to communicate
with database. This language is called Structured Query Language. The statement in SQL are
classified into five categories-
(a) Data definition language
(b) Data retrieval
(c) Data manipulation
(d) Transaction control
(e) Data control
Slide 20
Creating SQLite Database
We can create SQLite Database using Command Prompt and SQLite Studio.
Slide 22
Accessing SQLite Database using
Python
Python has a standard mechanism for accessing databases called DB-API. We need DB-API because
there need to be a standard way in which python program can connect to different databases.
The standard python distribution has inbuilt support for SQLite database connectivity. It contains
squlite3 module.
Developing a GUI using PyQT
The graphical user interface(GUI) is a form of user interface that allows users to interact with
electronic devices through graphical icons and visuals indicators. We can build GUI for
application using graphics library. This graphic library contains widgets. GUI applications are
designed to be event driven. Event means user does something by click of a button, drag,
mouse or type in text box.
Application Of Python
• Used to develop different application like web application, graphic user interface, software
development application, network programming.
• Use of python help in accessing the data base easily.
• Used in Raspberry Pi to interface different I/O device.
• Used in Image Processing
• For Automation
• Used as embedded scripting language.
Slide 29
Thank You
Slide 30

More Related Content

What's hot

Lesson 03 python statement, indentation and comments
Lesson 03   python statement, indentation and commentsLesson 03   python statement, indentation and comments
Lesson 03 python statement, indentation and commentsNilimesh Halder
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programmingSrinivas Narasegouda
 
Python If Else | If Else Statement In Python | Edureka
Python If Else | If Else Statement In Python | EdurekaPython If Else | If Else Statement In Python | Edureka
Python If Else | If Else Statement In Python | EdurekaEdureka!
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Pedro Rodrigues
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptxAkshayAggarwal79
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming LanguageTahani Al-Manie
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming pptismailmrribi
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to PythonNowell Strite
 
POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE teachersduniya.com
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An IntroductionSwarit Wadhe
 
Python programming workshop session 1
Python programming workshop session 1Python programming workshop session 1
Python programming workshop session 1Abdul Haseeb
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaPython Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaEdureka!
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialQA TrainingHub
 

What's hot (20)

Lesson 03 python statement, indentation and comments
Lesson 03   python statement, indentation and commentsLesson 03   python statement, indentation and comments
Lesson 03 python statement, indentation and comments
 
Python
PythonPython
Python
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Python basics
Python basicsPython basics
Python basics
 
Python If Else | If Else Statement In Python | Edureka
Python If Else | If Else Statement In Python | EdurekaPython If Else | If Else Statement In Python | Edureka
Python If Else | If Else Statement In Python | Edureka
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
 
Python ppt
Python pptPython ppt
Python ppt
 
Python variables and data types.pptx
Python variables and data types.pptxPython variables and data types.pptx
Python variables and data types.pptx
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming Language
 
Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
Introduction to Python
Introduction to PythonIntroduction to Python
Introduction to Python
 
POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Python programming workshop session 1
Python programming workshop session 1Python programming workshop session 1
Python programming workshop session 1
 
Beginning Python Programming
Beginning Python ProgrammingBeginning Python Programming
Beginning Python Programming
 
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | EdurekaPython Tutorial | Python Tutorial for Beginners | Python Training | Edureka
Python Tutorial | Python Tutorial for Beginners | Python Training | Edureka
 
Python | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python TutorialPython | What is Python | History of Python | Python Tutorial
Python | What is Python | History of Python | Python Tutorial
 

Similar to Python ppt

Government Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptxGovernment Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptxShivamDenge
 
Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Kiran Jonnalagadda
 
Safetty systems intro_embedded_c
Safetty systems intro_embedded_cSafetty systems intro_embedded_c
Safetty systems intro_embedded_cMaria Cida Rosa
 
employee turnover prediction document.docx
employee turnover prediction document.docxemployee turnover prediction document.docx
employee turnover prediction document.docxrohithprabhas1
 
Programming Language
Programming  LanguageProgramming  Language
Programming LanguageAdeel Hamid
 
presentation_intro_to_python
presentation_intro_to_pythonpresentation_intro_to_python
presentation_intro_to_pythongunanandJha2
 
presentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptpresentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptMohitChaudhary637683
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizeIruolagbePius
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxRohitKumar639388
 
Interview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfInterview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfExaminationSectionMR
 

Similar to Python ppt (20)

Shivam PPT.pptx
Shivam PPT.pptxShivam PPT.pptx
Shivam PPT.pptx
 
Government Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptxGovernment Polytechnic Arvi-1.pptx
Government Polytechnic Arvi-1.pptx
 
INTERNSHIP REPORT.docx
 INTERNSHIP REPORT.docx INTERNSHIP REPORT.docx
INTERNSHIP REPORT.docx
 
PYTHON PPT.pptx
PYTHON PPT.pptxPYTHON PPT.pptx
PYTHON PPT.pptx
 
Python Course.docx
Python Course.docxPython Course.docx
Python Course.docx
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)Python and Zope: An introduction (May 2004)
Python and Zope: An introduction (May 2004)
 
Programming
ProgrammingProgramming
Programming
 
Safetty systems intro_embedded_c
Safetty systems intro_embedded_cSafetty systems intro_embedded_c
Safetty systems intro_embedded_c
 
employee turnover prediction document.docx
employee turnover prediction document.docxemployee turnover prediction document.docx
employee turnover prediction document.docx
 
Python Course In Chandigarh
Python Course In ChandigarhPython Course In Chandigarh
Python Course In Chandigarh
 
Programming Language
Programming  LanguageProgramming  Language
Programming Language
 
Python
Python Python
Python
 
presentation_intro_to_python
presentation_intro_to_pythonpresentation_intro_to_python
presentation_intro_to_python
 
presentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.pptpresentation_intro_to_python_1462930390_181219.ppt
presentation_intro_to_python_1462930390_181219.ppt
 
Python (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualizePython (Data Analysis) cleaning and visualize
Python (Data Analysis) cleaning and visualize
 
pythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptxpythontraining-201jn026043638.pptx
pythontraining-201jn026043638.pptx
 
Technical Interview
Technical InterviewTechnical Interview
Technical Interview
 
Interview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdfInterview-level-QA-on-Python-Programming.pdf
Interview-level-QA-on-Python-Programming.pdf
 
Getting started with R
Getting started with RGetting started with R
Getting started with R
 

Recently uploaded

INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniquesugginaramesh
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniques
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Python ppt

  • 1. Python Programming Submitted By- Submitted To- Rachit Bhargava Naveen Dadhich 16EVJEC014 Slide 1
  • 2. Python Programming • Introduction To Python • Using Variables In Python • Basics Of Programming Python • Connecting To SQLite Database • Developing a GUI with PyQT Slide 2
  • 3. Introduction To Python • Python is a general purpose interpreted interactive object oriented and high level programming language . • It was first introduced in 1991 by Guido van Rossum, a Dutch computer programmer. • The language places strong emphasis on code reliability and simplicity so that the programmers can develop applications rapidly. • Python is multiprogramming language, which allows user to code in several different programming styles. • Python is widely used for scripting in Game menu applications effectively. • Most programs in Python require considerably less number of code to perform the same task compared to other languages like C. So less programming errors and reduces the development time needed also. Slide 3
  • 4. Installation Of Python • To learn language first, we have to download the software which is Python Interpreter. • To download Python Interpreter we go to the site https://www.python.org/downloads and click on the suitable icon. The website appears as below Slide 4
  • 5.
  • 6. Data Types And Variables Data Types are classification of data items Slide 6
  • 7. • Numeric – Any representation of data which has numeric value. Python identifies three types of numbers- integers, float and complex number. (a) Integer- Positive and negative whole numbers. Ex- 1234, -23 etc. (b) Float- Real numbers with a floating point representation in which the fractional component is denoted by a decimal or scientific notation. Ex- 55.55, -66.7 (c) Complex Number- A number with a real and imaginary component is represented as a+bj in Python. Ex- 5+6j • 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 Sequences data types are – String, List, and Tuple. Slide 7
  • 8. (a) String- A collection of one or more characters put in single, double or triple quotes. Ex- ‘Hello’, “Hello” (b) List- An ordered collection of one or more data items, not necessarily of same type, put in square brackets .Ex - [1,”Ravi”,75.50] (c) Tuple- An ordered collection of one or more data items, not necessarily of same type put in parentheses. Ex - (1, “Ravi”, 75.50) • Dictionary- An ordered collection of data in key:value pair form. Collection of such pairs is enclosed in curly brackets. Ex – {1:”Iron Man”, 2:”Thor”, 3:”Captain America”} Slide 8
  • 9. Variables Variables are the name given to the data that we need to store and manipulate in our program. For example, to store the age of the user, we can write a variable userAge and its is defined as below. userAge=0 or userAge=30 A variable can have short name. A variable start with a letter or the underscore character. A variable cannot start with a number. A variable name can only contain alpha-numeric and underscores(A-z, 0-9, _). Slide 9
  • 10. Basics Of Programming Program- It is set of instruction given to computers to perform a task. Computer Programming- It consists of two steps. Slide 10
  • 11. Operators In Python • Arithmetic Operators- These operators are used to perform basic mathematic operations. Ex- Addition x + y, Subtraction x – y, Multiplication x * y. • Assignment Operators- It is use to assign the value to the variables. Ex – x=5, x=x+3. • Comparison Operators- These operators compares the operands present on either side. Ex- x>y, x==y. It will give either true or false. • Logical Operators- These operators are python keywords that are used for joining two Boolean expression. Types of logical operators are- Slide 11
  • 12. Conditional Statements If Statement It is one of the commonly used control flow statements. It allows the program to evaluate if certain condition is met. It is used for decision making. Slide 12
  • 13. Else Statement The else statement is usually used when we have to judge one statement on the basis of other. If one condition goes wrong, then there should be another condition that should justify the statement or logic. Slide 13
  • 14. Loops In Python If the program close redirected towards any of earlier statement in the program than it is known as a loop. Types Of Loops- (a) While Loop (b) For loop Slide 14
  • 15. While Loop In python, while loop is used to execute a block of statement until a given condition is satisfied. And when the condition become false, the line immediately after the loop in program is executed. Syntax- Slide 15
  • 16. For Loop It is a control flow statement for specifying iteration, which allows code to be executed repeatedly. It starts with for keyword. Slide 16
  • 17. Connecting to SQLite Database Database- It is a collection of related data. It is a special type of computer file. Database is centralized program independent and organized collection of data which removes data redundancy and ensure data integrity. Database Model- (a) Network Model (b) Hierarchical Model (c) Relational Database Model Relational Database Data organized in one or more table called Relations. Each table represent one entity. Slide 17
  • 18.
  • 19.
  • 20. Relational Database Management System It is software for creating and managing database. It makes possible for us to read, create, update, delete data in a database. RDBMS software uses special language to communicate with database. This language is called Structured Query Language. The statement in SQL are classified into five categories- (a) Data definition language (b) Data retrieval (c) Data manipulation (d) Transaction control (e) Data control Slide 20
  • 21.
  • 22. Creating SQLite Database We can create SQLite Database using Command Prompt and SQLite Studio. Slide 22
  • 23.
  • 24. Accessing SQLite Database using Python Python has a standard mechanism for accessing databases called DB-API. We need DB-API because there need to be a standard way in which python program can connect to different databases. The standard python distribution has inbuilt support for SQLite database connectivity. It contains squlite3 module.
  • 25.
  • 26. Developing a GUI using PyQT The graphical user interface(GUI) is a form of user interface that allows users to interact with electronic devices through graphical icons and visuals indicators. We can build GUI for application using graphics library. This graphic library contains widgets. GUI applications are designed to be event driven. Event means user does something by click of a button, drag, mouse or type in text box.
  • 27.
  • 28.
  • 29. Application Of Python • Used to develop different application like web application, graphic user interface, software development application, network programming. • Use of python help in accessing the data base easily. • Used in Raspberry Pi to interface different I/O device. • Used in Image Processing • For Automation • Used as embedded scripting language. Slide 29