SlideShare a Scribd company logo
OBJECT –
ORIENTED
PROGRAMMING
IKSAN BUKHORI, M.PHIL.
TOPIC 1I: BASICS OF PYTHON PROGRAMMING
MOST MATERIALS IN THIS SLIDE ARE TAKEN FROM A VIDEO BY FREECODECAMP.ORG CHANNEL:
LEARN PYTHON - FULL COURSE FOR BEGINNERS [TUTORIAL]
VARIABLES AND DATA TYPES
Data
Types String
Numerical Data
integer
float
etc.
Boolean
True
False
etc.
WORKING WITH STRINGS
 print()
 Escape Character and
Newline
 Printing plain text using
variables
 Text Concatenation
WORKING WITH STRINGS: SOME FUNCTIONS FOR STRINGS
 lower() and upper()
 isupper() and islower
 Combining the usage of
multiple functions
 len(…)
 Character indexing ([])
 index(…)
 replace(… , …)
WORKING WITH NUMBERS: FUNCTIONS FOR NUMBERS
 Basic Arithmetic (+,-,*,%,…)
 Printing number with string
conversion
 String Concatenation vs
Arithmetic Addition
 abs(…)
 pow(… , …)
 max(… , … , ) and min(… , …, )
 round(…)
 Module import (math)
 floor(…) and ceil(…)
 sqrt(…)
GETTING INPUT FROM USER
 input(…)
 String to Number Casting/Conversion
LISTS AND ITS FUNCTIONS
 What is lists and how to create
it
 Multiple data types in a list
 Print the whole list
 Print certain element in the list
 Positive and Negative Indexing
 Print elements within a range
 Modify elements in the list
 extend()
 append()
 insert()
 remove() and clear()
 pop()
 Check if an element is in the list
using index()
 count()
 sort() and reverse()
 copy()
TUPLES
 Tuples vs Lists
 Printing element of a tuple
 List of Tuples
FUNCTION
 What is it?
 How to define it?
 Importance of indentation
 Function Calling
 Functions with Parameters
 Value returning function (return statement)
IF STATEMENT
 What is it?
 How to write it?
 IF statement with Boolean operation
 elif
 Comparison in IF statement
DICTIONARIES
 Key-value pairs
 How to create dictionary
 Print value based on key
 get() and default value
WHILE LOOP
 What is it
 How to write it
 Building Guessing Game
FOR LOOP
 What is it
 How to write it

More Related Content

Similar to (OOP Lec2) Basics of Python Programming.pptx

UNIT 1 - Revision of Basics - II.pptx
UNIT 1 - Revision of Basics - II.pptxUNIT 1 - Revision of Basics - II.pptx
UNIT 1 - Revision of Basics - II.pptx
NishanSidhu2
 
Top Python Online Training Institutes in Bangalore
Top Python Online Training Institutes in BangaloreTop Python Online Training Institutes in Bangalore
Top Python Online Training Institutes in Bangalore
SaagTechnologies
 
Vizwik Coding Manual
Vizwik Coding ManualVizwik Coding Manual
Vizwik Coding Manual
Vizwik
 
Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To Scala
Innar Made
 
DATA STRUCTURE CLASS 12 .pptx
DATA STRUCTURE CLASS 12 .pptxDATA STRUCTURE CLASS 12 .pptx
DATA STRUCTURE CLASS 12 .pptx
PritishMitra3
 
Power of functions in a typed world
Power of functions in a typed worldPower of functions in a typed world
Power of functions in a typed world
Debasish Ghosh
 
Pointer to function 1
Pointer to function 1Pointer to function 1
Pointer to function 1
Abu Bakr Ramadan
 
Recursion in C
Recursion in CRecursion in C
Recursion in C
v_jk
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
v_jk
 
Functional IO and Effects
Functional IO and EffectsFunctional IO and Effects
Functional IO and Effects
Dylan Forciea
 
Lect 14 Zaheer Abbas
Lect 14 Zaheer AbbasLect 14 Zaheer Abbas
Lect 14 Zaheer Abbas
Information Technology Center
 
MODULE. .pptx
MODULE.                              .pptxMODULE.                              .pptx
MODULE. .pptx
Alpha337901
 
Algebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsAlgebraic Data Types and Origami Patterns
Algebraic Data Types and Origami Patterns
Vasil Remeniuk
 
Fun with Kotlin
Fun with KotlinFun with Kotlin
Fun with Kotlin
Egor Andreevich
 
Python_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxPython_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptx
SahajShrimal1
 
An Introduction to Functional Programming using Haskell
An Introduction to Functional Programming using HaskellAn Introduction to Functional Programming using Haskell
An Introduction to Functional Programming using Haskell
Michel Rijnders
 
Functions
FunctionsFunctions
Functions
PatriciaPabalan
 
types.pdf
types.pdftypes.pdf
Ch06
Ch06Ch06
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
BAINIDA
 

Similar to (OOP Lec2) Basics of Python Programming.pptx (20)

UNIT 1 - Revision of Basics - II.pptx
UNIT 1 - Revision of Basics - II.pptxUNIT 1 - Revision of Basics - II.pptx
UNIT 1 - Revision of Basics - II.pptx
 
Top Python Online Training Institutes in Bangalore
Top Python Online Training Institutes in BangaloreTop Python Online Training Institutes in Bangalore
Top Python Online Training Institutes in Bangalore
 
Vizwik Coding Manual
Vizwik Coding ManualVizwik Coding Manual
Vizwik Coding Manual
 
Introduction To Scala
Introduction To ScalaIntroduction To Scala
Introduction To Scala
 
DATA STRUCTURE CLASS 12 .pptx
DATA STRUCTURE CLASS 12 .pptxDATA STRUCTURE CLASS 12 .pptx
DATA STRUCTURE CLASS 12 .pptx
 
Power of functions in a typed world
Power of functions in a typed worldPower of functions in a typed world
Power of functions in a typed world
 
Pointer to function 1
Pointer to function 1Pointer to function 1
Pointer to function 1
 
Recursion in C
Recursion in CRecursion in C
Recursion in C
 
RECURSION IN C
RECURSION IN C RECURSION IN C
RECURSION IN C
 
Functional IO and Effects
Functional IO and EffectsFunctional IO and Effects
Functional IO and Effects
 
Lect 14 Zaheer Abbas
Lect 14 Zaheer AbbasLect 14 Zaheer Abbas
Lect 14 Zaheer Abbas
 
MODULE. .pptx
MODULE.                              .pptxMODULE.                              .pptx
MODULE. .pptx
 
Algebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsAlgebraic Data Types and Origami Patterns
Algebraic Data Types and Origami Patterns
 
Fun with Kotlin
Fun with KotlinFun with Kotlin
Fun with Kotlin
 
Python_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptxPython_Unit-1_PPT_Data Types.pptx
Python_Unit-1_PPT_Data Types.pptx
 
An Introduction to Functional Programming using Haskell
An Introduction to Functional Programming using HaskellAn Introduction to Functional Programming using Haskell
An Introduction to Functional Programming using Haskell
 
Functions
FunctionsFunctions
Functions
 
types.pdf
types.pdftypes.pdf
types.pdf
 
Ch06
Ch06Ch06
Ch06
 
Python programming workshop
Python programming workshopPython programming workshop
Python programming workshop
 

Recently uploaded

LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
deepaannamalai16
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
giancarloi8888
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 

Recently uploaded (20)

LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
Standardized tool for Intelligence test.
Standardized tool for Intelligence test.Standardized tool for Intelligence test.
Standardized tool for Intelligence test.
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdfREASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
REASIGNACION 2024 UGEL CHUPACA 2024 UGEL CHUPACA.pdf
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 

(OOP Lec2) Basics of Python Programming.pptx

  • 2. TOPIC 1I: BASICS OF PYTHON PROGRAMMING MOST MATERIALS IN THIS SLIDE ARE TAKEN FROM A VIDEO BY FREECODECAMP.ORG CHANNEL: LEARN PYTHON - FULL COURSE FOR BEGINNERS [TUTORIAL]
  • 3. VARIABLES AND DATA TYPES Data Types String Numerical Data integer float etc. Boolean True False etc.
  • 4. WORKING WITH STRINGS  print()  Escape Character and Newline  Printing plain text using variables  Text Concatenation
  • 5. WORKING WITH STRINGS: SOME FUNCTIONS FOR STRINGS  lower() and upper()  isupper() and islower  Combining the usage of multiple functions  len(…)  Character indexing ([])  index(…)  replace(… , …)
  • 6. WORKING WITH NUMBERS: FUNCTIONS FOR NUMBERS  Basic Arithmetic (+,-,*,%,…)  Printing number with string conversion  String Concatenation vs Arithmetic Addition  abs(…)  pow(… , …)  max(… , … , ) and min(… , …, )  round(…)  Module import (math)  floor(…) and ceil(…)  sqrt(…)
  • 7. GETTING INPUT FROM USER  input(…)  String to Number Casting/Conversion
  • 8. LISTS AND ITS FUNCTIONS  What is lists and how to create it  Multiple data types in a list  Print the whole list  Print certain element in the list  Positive and Negative Indexing  Print elements within a range  Modify elements in the list  extend()  append()  insert()  remove() and clear()  pop()  Check if an element is in the list using index()  count()  sort() and reverse()  copy()
  • 9. TUPLES  Tuples vs Lists  Printing element of a tuple  List of Tuples
  • 10. FUNCTION  What is it?  How to define it?  Importance of indentation  Function Calling  Functions with Parameters  Value returning function (return statement)
  • 11. IF STATEMENT  What is it?  How to write it?  IF statement with Boolean operation  elif  Comparison in IF statement
  • 12. DICTIONARIES  Key-value pairs  How to create dictionary  Print value based on key  get() and default value
  • 13. WHILE LOOP  What is it  How to write it  Building Guessing Game
  • 14. FOR LOOP  What is it  How to write it