SlideShare ist ein Scribd-Unternehmen logo
1 von 15
PROGRAMMING
In (Python)
STRINGS
• A string is a data type that is used to represent a sequence of characters.
Such as numbers, text, spaces, punctuation, user name, communication with users, a
whole sentence or paragraph of data. Strings must be enclosed in quotation to
distinguish from variable names.
BASICS OF WORKING WITH
STRINGS
• Indexing
Each character in a string has an index
number, with the first character at
position 0. You can use the index to
reference individual characters in a string.
• Length
Length function : To find the number of
characters In a String
• Traversal
To cycle through each character of a
string. Mainly using Loops
MORE STRING MANIPULATION
• Finding Characters
with a certain Index
The index of a character is the position of
that character within a string. Which can be
accessed using square brackets.
• Changing Casings of
Characters
• Extracting Characters
By selecting characters from indexes 3 to
6, It leaves out the rest. Printing “put”
• Checking
Characters
‘put’ and ‘PUT’: ‘put’ is a substring of
‘Computer Science’ but ‘PUT’ is
not, so these examples will display ‘True’
then ‘False’.
DATA STRUCTURES
• A data structure is
an organized
collection of
related elements.
There are many
different data
structures that can
store multiple data
items used in
programming.
ARRAYS
• An array is an organized
collection of related values with
a single shared identifier. All
the elements in an array are the
same data type, where each has
a unique index value denoting
its position in the array.
• One/ Single dimension array
where the data are stored in the
sequential order. For example, it
can be used to store name or
mobile number or grade
• A multidimensional array is an ‘array of arrays’; where
each item at an index is another array
LISTS
• Lists are easier to use as they are dynamic – they do not have a fixed size and can grow as new
elements are added. When they are declared they do not have to be given a size and can grow as
new elements are added.
• In Python, arrays are not
commonly used. Instead lists are
used but they are very similar in
the way that they operate. Just
like an array, a list is created by
adding items, separated by
commas, inside square brackets
WHICH ONE TO USE ? :
ALGORITHMS
• An algorithm is a precise method of solving a problem.
VARIABLE INITIALIZATION & DATA
TYPES
• When algorithms are
converted into programs, the
computer needs to be told
what type of data is stored in
each variable. Every
programming language has a
number of built-in data
types.
• When a variable is declared, the computer gives it a location in its
memory. Initially, this location is empty, so before a variable can
be used it has to be given a value.
SEQUENCE : SELECTION : ITERATION
• There are three key building blocks of algorithms : They are command sequence, selection
and iteration.
• Sequence
• The order in which
instructions occur
and are processed
• Selection
• Making decisions
by asking a
question &
depending on the
outcome, follow
one of the two
paths or take
certain actions &
ignore others
SELECTING WITH IF STATEMENTS:
• The IF statement is a decision-
making statement that guides
a program to make decisions
based on specified criteria
• The Nested if statement allows
you to create a chain of if
statements. The if statements
are evaluated in order until one
of the if expressions is true or
the end of the if chain is
reached. If the end of the chain
is reached without a true
expression no code blocks are
executed.
ITERATION (LOOPS) :
• Indefinite Loop : A loop where it
is not easy to know amount of
execution required.
• Definite Loops : A loop that
executes a known number of times.
This type of loop can be executed
using while statements
This type of loop can be executed
using for statements
Nested for Loop : The inner loop
will finish all of it’s iterations before
finishing one iteration of the ‘ outer
loop’
Computer Sience, This is my presentation for beginners coding in python

Weitere ähnliche Inhalte

Ähnlich wie Computer Sience, This is my presentation for beginners coding in python

Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical ExpressionsUnit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressionsdubon07
 
Engineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxEngineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxhardii0991
 
data science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfdata science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfmukeshgarg02
 
Module 3,4.pptx
Module 3,4.pptxModule 3,4.pptx
Module 3,4.pptxSandeepR95
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)Dilawar Khan
 
Unit 2 linear data structures
Unit 2   linear data structuresUnit 2   linear data structures
Unit 2 linear data structuresSenthil Murugan
 
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03) iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03) Jonathan Engelsma
 
Unit 1 array based implementation
Unit 1  array based implementationUnit 1  array based implementation
Unit 1 array based implementationLavanyaJ28
 

Ähnlich wie Computer Sience, This is my presentation for beginners coding in python (20)

Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical ExpressionsUnit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
Unit 4 - Basic ABAP statements, ABAP Structures and ABAP Logical Expressions
 
Engineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxEngineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptx
 
enum_namespace.ppt
enum_namespace.pptenum_namespace.ppt
enum_namespace.ppt
 
data science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfdata science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdf
 
ds bridge.pptx
ds bridge.pptxds bridge.pptx
ds bridge.pptx
 
Module 3,4.pptx
Module 3,4.pptxModule 3,4.pptx
Module 3,4.pptx
 
CS4443 - Modern Programming Language - I Lecture (2)
CS4443 - Modern Programming Language - I  Lecture (2)CS4443 - Modern Programming Language - I  Lecture (2)
CS4443 - Modern Programming Language - I Lecture (2)
 
Unit 2 linear data structures
Unit 2   linear data structuresUnit 2   linear data structures
Unit 2 linear data structures
 
12.6-12.9.pptx
12.6-12.9.pptx12.6-12.9.pptx
12.6-12.9.pptx
 
Apex code (Salesforce)
Apex code (Salesforce)Apex code (Salesforce)
Apex code (Salesforce)
 
Java best practices
Java best practicesJava best practices
Java best practices
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Unit 4 plsql
Unit 4  plsqlUnit 4  plsql
Unit 4 plsql
 
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03) iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03)
 
Variables&DataTypes.pptx
Variables&DataTypes.pptxVariables&DataTypes.pptx
Variables&DataTypes.pptx
 
lecture 02.2.ppt
lecture 02.2.pptlecture 02.2.ppt
lecture 02.2.ppt
 
ITFT - Java
ITFT - JavaITFT - Java
ITFT - Java
 
stack.pptx
stack.pptxstack.pptx
stack.pptx
 
Unit 1 array based implementation
Unit 1  array based implementationUnit 1  array based implementation
Unit 1 array based implementation
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
 

Kürzlich hochgeladen

Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptxPoojaSen20
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....Ritu480198
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismDabee Kamal
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project researchCaitlinCummins3
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppCeline George
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhleson0603
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 

Kürzlich hochgeladen (20)

Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinhĐề tieng anh thpt 2024 danh cho cac ban hoc sinh
Đề tieng anh thpt 2024 danh cho cac ban hoc sinh
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 

Computer Sience, This is my presentation for beginners coding in python

  • 2. STRINGS • A string is a data type that is used to represent a sequence of characters. Such as numbers, text, spaces, punctuation, user name, communication with users, a whole sentence or paragraph of data. Strings must be enclosed in quotation to distinguish from variable names.
  • 3. BASICS OF WORKING WITH STRINGS • Indexing Each character in a string has an index number, with the first character at position 0. You can use the index to reference individual characters in a string. • Length Length function : To find the number of characters In a String • Traversal To cycle through each character of a string. Mainly using Loops
  • 4. MORE STRING MANIPULATION • Finding Characters with a certain Index The index of a character is the position of that character within a string. Which can be accessed using square brackets. • Changing Casings of Characters • Extracting Characters By selecting characters from indexes 3 to 6, It leaves out the rest. Printing “put” • Checking Characters ‘put’ and ‘PUT’: ‘put’ is a substring of ‘Computer Science’ but ‘PUT’ is not, so these examples will display ‘True’ then ‘False’.
  • 5. DATA STRUCTURES • A data structure is an organized collection of related elements. There are many different data structures that can store multiple data items used in programming.
  • 6. ARRAYS • An array is an organized collection of related values with a single shared identifier. All the elements in an array are the same data type, where each has a unique index value denoting its position in the array. • One/ Single dimension array where the data are stored in the sequential order. For example, it can be used to store name or mobile number or grade • A multidimensional array is an ‘array of arrays’; where each item at an index is another array
  • 7. LISTS • Lists are easier to use as they are dynamic – they do not have a fixed size and can grow as new elements are added. When they are declared they do not have to be given a size and can grow as new elements are added. • In Python, arrays are not commonly used. Instead lists are used but they are very similar in the way that they operate. Just like an array, a list is created by adding items, separated by commas, inside square brackets
  • 8. WHICH ONE TO USE ? :
  • 9. ALGORITHMS • An algorithm is a precise method of solving a problem.
  • 10. VARIABLE INITIALIZATION & DATA TYPES • When algorithms are converted into programs, the computer needs to be told what type of data is stored in each variable. Every programming language has a number of built-in data types. • When a variable is declared, the computer gives it a location in its memory. Initially, this location is empty, so before a variable can be used it has to be given a value.
  • 11. SEQUENCE : SELECTION : ITERATION • There are three key building blocks of algorithms : They are command sequence, selection and iteration.
  • 12. • Sequence • The order in which instructions occur and are processed • Selection • Making decisions by asking a question & depending on the outcome, follow one of the two paths or take certain actions & ignore others
  • 13. SELECTING WITH IF STATEMENTS: • The IF statement is a decision- making statement that guides a program to make decisions based on specified criteria • The Nested if statement allows you to create a chain of if statements. The if statements are evaluated in order until one of the if expressions is true or the end of the if chain is reached. If the end of the chain is reached without a true expression no code blocks are executed.
  • 14. ITERATION (LOOPS) : • Indefinite Loop : A loop where it is not easy to know amount of execution required. • Definite Loops : A loop that executes a known number of times. This type of loop can be executed using while statements This type of loop can be executed using for statements Nested for Loop : The inner loop will finish all of it’s iterations before finishing one iteration of the ‘ outer loop’