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
 
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
 
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
 
chapter 5.ppt
chapter 5.pptchapter 5.ppt
chapter 5.ppt
 

Kürzlich hochgeladen

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 

Kürzlich hochgeladen (20)

Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 

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’