SlideShare une entreprise Scribd logo
1  sur  39
BY
DR.BELMER GLADSON.V M.E.,Ph.D.,
ASSOCIATE PROFESSOR
ADHI COLLEGE OF ENGINEERING AND TECHNOLOGY
CONTENTS
 INTRODUCTION
 PROBLEM SOLVING TECHNIQUES
 ALGORITHMIC STRATEGIES
 FUNCTIONS
 PYTHON – VARIABLES AND OPERATORS
 CONTROL STRUCTURES
 STRINGS AND STRING MANIPULATION
 LIST,TUPLES AND DICTIONARY
INTRODUCTION
 Python is a general-purpose interpreted, interactive,
object-oriented, and high-level programming
language.
 It was created by Guido van Rossum during 1985- 1990
Why to Learn Python?
 Python is a high-level, interpreted, interactive and
object-oriented scripting language.
 Designed- highly readable.
 Uses English Keywords frequently.
 To become a great Software Engineer – Web
Development Domain.
 Python is Interpreted
 Python is Interactive
 Python is Object-Oriented
 Python is a Beginner's Language
Applications of Python
 Easy-to-learn
 Easy-to-read
 Easy-to-maintain
 Interactive Mode
 Portable
 OpenSource
 Real Time Applications
 Bit Torrent file sharing
 Google search engine, YouTube
 Face book, Drop box
PROBLEM SOLVING TECHNIQUES
 Define the problem and creating number of solutions.
 Starts –Problem specification, Ends – Correct
Program.
PROBLEM SOLVING TECHNIQUES
• Set of techniques that helps in providing logic –solve
the problem.
1. Algorithms.
2. Flowcharts.
3. Pseudo codes.
4. Programs
ALGORITHM
 Sequence of instructions that describe a method.
Qualities of an Algorithm:
 Should be written in simple English
 Should be precise and unambiguous.
 Should not be repeated infinitely.
 should conclude after a finite number of steps.
 Should have an end point
 Derived results should be obtained only after the
algorithm terminates.
Example:
Addition of Two Numbers:
1.Start
2. Read the value of ‘a’
3. Read the value of ‘b’
4. Calculate sum=a+b
5. Print the sum of two number
6. Stop
Flowchart
---Graphical Representation of an Algorithm
Example:
Pseudocode
 Informal high-level description.
 Example:
 To find sum of two numbers
1.READ num1,num2
2.sum=num1+num2
3.PRINT sum
Program
 Program= Algorithm +Data
 Set of instruction, to the computer to solve a problem.
 Accept the data to perform computation.
ALGORITHMIC STRATEGIES
FUNCTIONS
 Block of organized, reusable code that is used to
perform a single, related action.
 Methods, sub-routines.
 Syntax
function_name(parameters)
function statements
end function
Algorithm for addition of two
numbers using function
 Main function()
Step 1: Start
Step 2:Call the function add()
Step 3: Stop
• Sub function add()
Step1:Functionstart
Step2:Geta,bValues
Step 3: add c=a+b
Step 4: Print c
Step 5: Return
VARIABLES:
 Store a value by assigning it to a name.
 It can be of any length. No space is allowed
 Assigning value to variable:
 >>>counter =45
print (counter)
 single value to several variables
a=b=c=100
 Multiple values to multiple variables
>>>a,b,c=2,4,"ram"
OPERATORS
 Constructs which can manipulate the value of operands.
expression 4 + 5 = 9
 Types of Operators
 Arithmetic Operators
 Comparison (Relational)Operators
 Assignment Operators
 Logical Operators
 Bitwise Operators
 Membership Operators
 Identity Operators
Arithmetic operators:
Comparison (Relational)Operators
Assignment Operators
Logical Operators:
Bitwise Operators:
Membership Operators:
CONTROL STRUCTURES
 Conditional Statements
Conditional if
Alternative if… else
Chained if…elif…else
Nested if….else
Conditional if
Alternative if… else
Chained if…elif…else
Example
Nested if….else
Example:
STRINGS AND STRING MANIPULATION
 Series or sequence of characters
 Strings are marked by quotes:
Single quotes(' ') E.g., 'This a string in single quotes'
Double quotes(" ") E.g., "'This a string in double quotes‘”
Triple quotes(""" """)E.g., """This is a paragraph. It is
made up of multiple lines and sentences.""“
 Strings are Immutable
Operations on string
Lists
 List is an ordered sequence of items
 square brackets[]
 Items in the lists can be of different datatypes
 Operations on list: Indexing, Slicing ,Concatenation
Repetitions, Updation, Insertion, Deletion
Operations on list
Tuple:
 A tuple is same as list
 Parentheses()
 A tuple is an immutable list
 Benefit of Tuple:
 Tuples are faster than lists.
 If the user wants to protect the data from accidental changes,
tuple can be used
Basic Operations:
Dictionaries
 Dictionaries are unorderedsets.
 curly brackets{}
 Dictionaries are accessed via keys
Operations:
PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx

Contenu connexe

Tendances

Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabusSugantha T
 
Introduction to Problem Solving Techniques- Python
Introduction to Problem Solving Techniques- PythonIntroduction to Problem Solving Techniques- Python
Introduction to Problem Solving Techniques- PythonPriyankaC44
 
POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE teachersduniya.com
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm designNahid Hasan
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAMaulik Borsaniya
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming LanguageLaxman Puri
 
Python-00 | Introduction and installing
Python-00 | Introduction and installingPython-00 | Introduction and installing
Python-00 | Introduction and installingMohd Sajjad
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners Sujith Kumar
 
Python Programming language
Python Programming languagePython Programming language
Python Programming languageHadeelAlbedah
 
Analysis and Design of Algorithms
Analysis and Design of AlgorithmsAnalysis and Design of Algorithms
Analysis and Design of AlgorithmsBulbul Agrawal
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An IntroductionSwarit Wadhe
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonAgung Wahyudi
 
Python programming introduction
Python programming introductionPython programming introduction
Python programming introductionSiddique Ibrahim
 

Tendances (20)

Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Python course syllabus
Python course syllabusPython course syllabus
Python course syllabus
 
Introduction to Compiler design
Introduction to Compiler design Introduction to Compiler design
Introduction to Compiler design
 
Introduction to Problem Solving Techniques- Python
Introduction to Problem Solving Techniques- PythonIntroduction to Problem Solving Techniques- Python
Introduction to Problem Solving Techniques- Python
 
POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE POWER OF PYTHON PROGRAMMING LANGUAGE
POWER OF PYTHON PROGRAMMING LANGUAGE
 
Programming
ProgrammingProgramming
Programming
 
Our presentation on algorithm design
Our presentation on algorithm designOur presentation on algorithm design
Our presentation on algorithm design
 
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYAChapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
Chapter 1 - INTRODUCTION TO PYTHON -MAULIK BORSANIYA
 
Python Programming Language
Python Programming LanguagePython Programming Language
Python Programming Language
 
Python-00 | Introduction and installing
Python-00 | Introduction and installingPython-00 | Introduction and installing
Python-00 | Introduction and installing
 
computer graphics unit 1-I.pptx
computer graphics unit 1-I.pptxcomputer graphics unit 1-I.pptx
computer graphics unit 1-I.pptx
 
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
 
Python Programming language
Python Programming languagePython Programming language
Python Programming language
 
Python
PythonPython
Python
 
Python basic
Python basicPython basic
Python basic
 
Analysis and Design of Algorithms
Analysis and Design of AlgorithmsAnalysis and Design of Algorithms
Analysis and Design of Algorithms
 
Python final ppt
Python final pptPython final ppt
Python final ppt
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python programming introduction
Python programming introductionPython programming introduction
Python programming introduction
 

Similaire à PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx

Python Programming - II. The Basics
Python Programming - II. The BasicsPython Programming - II. The Basics
Python Programming - II. The BasicsRanel Padon
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptxNileshBorkar12
 
An Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAn Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAdam Getchell
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...Make Mannan
 
Python_Haegl.powerpoint presentation. tx
Python_Haegl.powerpoint presentation. txPython_Haegl.powerpoint presentation. tx
Python_Haegl.powerpoint presentation. txvishwanathgoudapatil1
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonRanjith kumar
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python ProgrammingDozie Agbo
 
علم البيانات - Data Sience
علم البيانات - Data Sience علم البيانات - Data Sience
علم البيانات - Data Sience App Ttrainers .com
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshopamptiny
 
Recent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP ApproachesRecent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP ApproachesIRJET Journal
 
PART - 1 Python Introduction- Variables- Data types - Numeric- String- Boole...
PART - 1  Python Introduction- Variables- Data types - Numeric- String- Boole...PART - 1  Python Introduction- Variables- Data types - Numeric- String- Boole...
PART - 1 Python Introduction- Variables- Data types - Numeric- String- Boole...manikamr074
 
C#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New FeaturesC#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New Featurestechfreak
 

Similaire à PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx (20)

Python Programming - II. The Basics
Python Programming - II. The BasicsPython Programming - II. The Basics
Python Programming - II. The Basics
 
Python
PythonPython
Python
 
Automation Testing theory notes.pptx
Automation Testing theory notes.pptxAutomation Testing theory notes.pptx
Automation Testing theory notes.pptx
 
Introduction of Python
Introduction of PythonIntroduction of Python
Introduction of Python
 
An Overview Of Python With Functional Programming
An Overview Of Python With Functional ProgrammingAn Overview Of Python With Functional Programming
An Overview Of Python With Functional Programming
 
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org)  (usef...
Lab manual object oriented technology (it 303 rgpv) (usefulsearch.org) (usef...
 
Python_Haegl.powerpoint presentation. tx
Python_Haegl.powerpoint presentation. txPython_Haegl.powerpoint presentation. tx
Python_Haegl.powerpoint presentation. tx
 
INTERNSHIP REPORT.docx
 INTERNSHIP REPORT.docx INTERNSHIP REPORT.docx
INTERNSHIP REPORT.docx
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
C++ book
C++ bookC++ book
C++ book
 
Welcome to python workshop
Welcome to python workshopWelcome to python workshop
Welcome to python workshop
 
MODULE 1.pptx
MODULE 1.pptxMODULE 1.pptx
MODULE 1.pptx
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 
First Steps in Python Programming
First Steps in Python ProgrammingFirst Steps in Python Programming
First Steps in Python Programming
 
علم البيانات - Data Sience
علم البيانات - Data Sience علم البيانات - Data Sience
علم البيانات - Data Sience
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshop
 
Recent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP ApproachesRecent Trends in Translation of Programming Languages using NLP Approaches
Recent Trends in Translation of Programming Languages using NLP Approaches
 
Oops ppt
Oops pptOops ppt
Oops ppt
 
PART - 1 Python Introduction- Variables- Data types - Numeric- String- Boole...
PART - 1  Python Introduction- Variables- Data types - Numeric- String- Boole...PART - 1  Python Introduction- Variables- Data types - Numeric- String- Boole...
PART - 1 Python Introduction- Variables- Data types - Numeric- String- Boole...
 
C#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New FeaturesC#3.0 & Vb 9.0 New Features
C#3.0 & Vb 9.0 New Features
 

Dernier

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
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
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
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
 
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
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
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
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 

Dernier (20)

Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
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
 
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)
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
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...
 
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
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
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
 
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 

PROBLEM SOLVING TECHNIQUES USING PYTHON.pptx

  • 1. BY DR.BELMER GLADSON.V M.E.,Ph.D., ASSOCIATE PROFESSOR ADHI COLLEGE OF ENGINEERING AND TECHNOLOGY
  • 2. CONTENTS  INTRODUCTION  PROBLEM SOLVING TECHNIQUES  ALGORITHMIC STRATEGIES  FUNCTIONS  PYTHON – VARIABLES AND OPERATORS  CONTROL STRUCTURES  STRINGS AND STRING MANIPULATION  LIST,TUPLES AND DICTIONARY
  • 3. INTRODUCTION  Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language.  It was created by Guido van Rossum during 1985- 1990
  • 4. Why to Learn Python?  Python is a high-level, interpreted, interactive and object-oriented scripting language.  Designed- highly readable.  Uses English Keywords frequently.  To become a great Software Engineer – Web Development Domain.  Python is Interpreted  Python is Interactive  Python is Object-Oriented  Python is a Beginner's Language
  • 5. Applications of Python  Easy-to-learn  Easy-to-read  Easy-to-maintain  Interactive Mode  Portable  OpenSource  Real Time Applications  Bit Torrent file sharing  Google search engine, YouTube  Face book, Drop box
  • 6. PROBLEM SOLVING TECHNIQUES  Define the problem and creating number of solutions.  Starts –Problem specification, Ends – Correct Program. PROBLEM SOLVING TECHNIQUES • Set of techniques that helps in providing logic –solve the problem. 1. Algorithms. 2. Flowcharts. 3. Pseudo codes. 4. Programs
  • 7. ALGORITHM  Sequence of instructions that describe a method. Qualities of an Algorithm:  Should be written in simple English  Should be precise and unambiguous.  Should not be repeated infinitely.  should conclude after a finite number of steps.  Should have an end point  Derived results should be obtained only after the algorithm terminates.
  • 8. Example: Addition of Two Numbers: 1.Start 2. Read the value of ‘a’ 3. Read the value of ‘b’ 4. Calculate sum=a+b 5. Print the sum of two number 6. Stop
  • 11. Pseudocode  Informal high-level description.  Example:  To find sum of two numbers 1.READ num1,num2 2.sum=num1+num2 3.PRINT sum
  • 12. Program  Program= Algorithm +Data  Set of instruction, to the computer to solve a problem.  Accept the data to perform computation.
  • 14. FUNCTIONS  Block of organized, reusable code that is used to perform a single, related action.  Methods, sub-routines.  Syntax function_name(parameters) function statements end function
  • 15. Algorithm for addition of two numbers using function  Main function() Step 1: Start Step 2:Call the function add() Step 3: Stop • Sub function add() Step1:Functionstart Step2:Geta,bValues Step 3: add c=a+b Step 4: Print c Step 5: Return
  • 16. VARIABLES:  Store a value by assigning it to a name.  It can be of any length. No space is allowed  Assigning value to variable:  >>>counter =45 print (counter)  single value to several variables a=b=c=100  Multiple values to multiple variables >>>a,b,c=2,4,"ram"
  • 17. OPERATORS  Constructs which can manipulate the value of operands. expression 4 + 5 = 9  Types of Operators  Arithmetic Operators  Comparison (Relational)Operators  Assignment Operators  Logical Operators  Bitwise Operators  Membership Operators  Identity Operators
  • 24. CONTROL STRUCTURES  Conditional Statements Conditional if Alternative if… else Chained if…elif…else Nested if….else
  • 31. STRINGS AND STRING MANIPULATION  Series or sequence of characters  Strings are marked by quotes: Single quotes(' ') E.g., 'This a string in single quotes' Double quotes(" ") E.g., "'This a string in double quotes‘” Triple quotes(""" """)E.g., """This is a paragraph. It is made up of multiple lines and sentences.""“  Strings are Immutable
  • 33. Lists  List is an ordered sequence of items  square brackets[]  Items in the lists can be of different datatypes  Operations on list: Indexing, Slicing ,Concatenation Repetitions, Updation, Insertion, Deletion
  • 35. Tuple:  A tuple is same as list  Parentheses()  A tuple is an immutable list  Benefit of Tuple:  Tuples are faster than lists.  If the user wants to protect the data from accidental changes, tuple can be used
  • 37. Dictionaries  Dictionaries are unorderedsets.  curly brackets{}  Dictionaries are accessed via keys