Variables and Data Types(Python
Variables and Data Types(Python
TYPES (PYTHON]
Presented by Kean Psalm Escorial
and
Johannes B. Geolina
Objectives
A Variable is
create when
Output:
you assign a
value to it.
Variables
Example:
Variables do not
need to be
declared with any
particular type, Output:
and can even
change type after
they have been
set.
Variables
Example:
CASTING
If you want to
specify the data
type of a variable,
this can be done
with casting.
Variables
Example:
Case-Sensitive
Variable names
are case-
sensitive.
Purpose of Variables
Camel Case
Pascal Case
Snake Case
Variable Names
Camel Case
Each word, except the first, starts with a capital
letter:
Variable Names
Pascal Case
Each word starts with a
capital letter:
Variable Names
Snake Case
Each word is separated by an underscore character:
Misuse of Reserved Keywords
What Are Reserved Keywords?
Instructions:
1.Analyze the following Python script.
2.Identify the errors in variable declaration,
assignment, or usage.
3.Rewrite the corrected version of the script.
CORRECT, AN
ERROR
# Debug the following script
CORRECT, AN
# Corrected script ERROR
Real-Life Applications
Financial Calculations
• Track and calculate expenses, income, and
budgets.
Decision Making
• Use variables to determine conditions and
outcomes.
Data Analysis
• Store and manipulate datasets for analysis.