0% found this document useful (0 votes)
31 views84 pages

q2 Lesson 6 Computer 10

The document discusses various data types in Python including numeric, string, list, tuple, and set data types. It provides examples of each data type and how they can be used to store different types of data. It also discusses type conversion and built-in functions like type() to check data types. Exercises are included for readers to practice working with each of the data types.

Uploaded by

margaretnablo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views84 pages

q2 Lesson 6 Computer 10

The document discusses various data types in Python including numeric, string, list, tuple, and set data types. It provides examples of each data type and how they can be used to store different types of data. It also discusses type conversion and built-in functions like type() to check data types. Exercises are included for readers to practice working with each of the data types.

Uploaded by

margaretnablo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 84

OPENING

PRAYER
Sto. Niño… Bless Us…
Our Lady of Consolation…
Pray for Us…
Our Father St. Augustine…
Pray for Us…
Mother Rita, Venerable Mother Consuelo
and Sor. Teresa Andrada, OSA…
Intercede for Us…

My heart is restless until it rests in you, O


God!
BIBLE VERSE
OF THE
TODAY
CHECKING
OF
ATTENDANCE
THUMBS UP
OR
THUMBS
DOWN
1. Flowchart is a
visual
representation of
the sequence of
steps needed to
perform a
process.
1. Flowchart is a
visual
representation of
the sequence of
steps needed to
perform a
process.
2. Conditional
control
structure is
the order of
succession.
2. Conditional
control
structure is
the order of
succession.
3. It is for input or
output which
represent resources
used or generated

ENTER
TEXT
3. It is for input or
output which
represent resources
used or generated.

ENTER
TEXT
4. This shape
represents a
process, action,
or function.

RESULT A + B
4. This shape
represents a
process, action,
or function.

RESULT A + B
5. HTML is
popular for
beginners due
to its simple
and readable
syntax.
5. HTML is
popular for
beginners due
to its simple
and readable
syntax.
6. Identifiers are
names used to
identify variables,
functions,
classes,
modules, etc.
6. Identifiers are
names used to
identify variables,
functions,
classes,
modules, etc.
7. Multiple words
can be separated
using an
underscore or
Camel Case style
of writing.
7. Multiple words
can be separated
using an
underscore or
Camel Case style
of writing.
8. Identifiers
such as
Variable can
be used as a
Keyword.
8. Identifiers
such as
Variable can
be used as a
Keyword.
9. You cannot
use special
characters
except
underscore in
a variable.
9. You cannot
use special
characters
except
underscore in
a variable.
10. Python
is a case-
sensitive
language.
10. Python
is a case-
sensitive
language.
GIVE ME
THE
RESULT
#Exercise 1
Drink_1 = milk
Drink_2 = coffee
Drink_3 = tea

print(Drink_1)
print(Drink_2)
Print(Drink_3)
#Exercise 2
a=7
b=1
a=9
c=4
print(a)
print(b)
print(a)
print(c)
#Exercise 3
mynie = “moe”
eenie = “mynie”
meenie = “eenie”
moe = “meenie”
print(eenie)
print(meenie)
print(mynie)
print(moe)
#Exercise 4
Joe_Mark = “Cuaton”
10Computer = “Python”
#3rdQuarter = “January”

print(joe)
print(10Computer)
print(#3rdQuarter)
OUTPUT
VARIABLES AND
DATA TYPES
COMPUTER 10
PREPARED BY: JOE MARK J. CUATON
CKPAUNING
UNPACKING
TNRIP
PRINT
PTEY
TYPE
UNPACK A COLLECTION
If you have a collection of values in
a list, tuple etc. Python allows you
to extract the values into variables.
This is called unpacking.
UNPACK A COLLECTION
OUTPUT VARIABLE
• The Python print()
function is often used
to output variables.
OUTPUT VARIABLE
• In the print() function,
you output multiple
variables, separated by
a comma.
OUTPUT VARIABLE
• You can also use the +
operator to output
multiple variables.
OUTPUT VARIABLE
• For numbers, the +
character works as a
mathematical operator.
OUTPUT VARIABLE
• In the print() function, when
you try to combine a string
and a number with the +
operator, Python will give
you an error.
OUTPUT VARIABLE
• The best way to output multiple
variables in the print() function
is to separate them with
commas, which even support
different data types.
Built-in Data Types
• In programming, data type is an
important concept.
• Variables can store data of
different types, and different
types can do different things.
Built-in Data Types
• We can use the type() function to
know which class a variable or a
value belongs to.
Built-in Data Types
• Python has the following data
types built-in by default, in
these categories:
Numeric Data type
• In Python, numeric data type is used to
hold numeric values.
• Integers, floating-point numbers and
complex numbers fall under Python
numbers category. They are defined as
int, float and complex classes in Python.
Numeric Data type
• int - holds signed integers of non-
limited length.
• float - holds floating decimal points
and it's accurate up to 15 decimal
places.
• complex - holds complex numbers.
Numeric Data type
Numeric Data type
EXERCISE
Numeric Data type
Conversion of Data Types
• We can convert different
data types by using
different type conversion
functions.
Conversion of Data Types
Set Data Type
• Set is an unordered
collection of unique items.
Set is defined by values
separated by commas inside
braces { }.
Set Data Type
Set Data Type
EXERCISE
Set Data type
String Data Type
• String is a sequence of
characters represented by
either single or double
quotes.
String Data Type
String Data Type
EXERCISE
String Data type
List Data Type
• List is an ordered collection
of similar or different types of
items separated by commas
and enclosed within brackets
[ ].
List Data Type
• Index starts from zero (0).
This means that we start
counting from zero (0),
instead of one (1).
List Data Type
EXERCISE
List Data type
Tuple Data Type
• Tuple is an ordered sequence
of items same as a list. The
only difference is that tuples
are immutable. Tuples once
created cannot be modified.
Tuple Data Type
• In Python, we use the
parentheses () to store items of
a tuple.
• Use slicing operator or brackets
[ ] to extract the items.
Tuple Data Type
EXERCISE
Tuple Data type
Prayer for
Beatification of
Venerable Mother
Consuelo
God of Love and Compassion, you endowed Mother Consuelo with
great love and zeal for you honor and glory
We commend to you her life and example of love of God and
neighbor.
With faith and trust in your gracious providence, we pray for her
beatification so that she may continue to inspire us in seeking your
will and living a holy life.
God of mercy, we also humbly present to you our need,
united with the confirmation of the holiness of life of Mother
Consuelo…(PAUSE- prayer petition)
…in gratitude for your boundless blessings, we praise and thank
you, our God, Father, Son and Holy Spirit. Amen.

You might also like