Week 03 Variables and Data Types
Week 03 Variables and Data Types
ෙනාහැක්කක් ෙනාමැත
www.heladevs.org
Where we are ??
What is Programming
Intro Control flow Functions
Computing Languages
Variables &
Data Types
week-01 week-14
Previous This Week Integer 23
Week Python type system
Programming languages and the Complex 1+3j
importance of programming ● Data types number
○ Explain what is a data type and Numeric
● Binary world types available in python Float 32.15
● Dynamic typing
● Programming Language , Grammar ○ Briefly discuss what is dynamic Dictionary {1:q’, 2:’k’}
● Compiled vs Interpreted languages typing and how
○ Show the difference of each type ● Casting
and how the instructions to the
Python Boolean True, False
○ Type casting in python
computer are carried out. Also Data
discuss pros & cons of each type. Types {2,3,6,4’}
Set
● Brief history
○ Discuss the history of String “heladevs”
programming languages and how
they evolved Sequence
● Evolution of programming languages Lists [2,’er’9,2]
Type
○ Explain how programming
languages evolved over time
● Levels of abstractions
Tuple (3,7,’pen’)
VS
int - Integers
● Integers are whole numbers without any fractional or decimal parts
● Python uses IEEE 754 for floats, Python has a precision of approximately 15 to 17 decimal digits
● Boolean values can be created using ==, !=, >, <, >=, and <= operators
str - Strings
● String is a sequence of characters enclosed within single quotes (' '), double quotes (" "), or
split()
● Lists can hold any type of data (ie. int, str, float.. even other lists! )
Complex 1+3j
number
Numeric
Float 32.15
Tuple (3,7,’pen’)
Type Conversion
float() Returns a floating-point object constructed
from a number or string
int() Returns an integer object constructed from
a number or string
str() Returns string version of an object
bool() Converts an argument to a Boolean value
chr() Returns string representation of character
given by integer argument
Memory Organization
Memory
● Heap - Dynamic memory
● Stack - Functions, local variables
● Static / Global - Global variables
● Code - Instructions
Python Names
Python Names
Understanding Python Variables
Understanding Python Variables
Understanding Python Variables
Generational GC
https://en.wikiversity.org/wiki/Introduction_to_Programming/About_Programming
So What’s Dynamic Typing?
● Dynamic typing is a feature of Python that allows a variable to be
bound to objects of different types during the execution of a
program.
So What’s Dynamic Typing? Cont..
So What’s Dynamic Typing? Cont..
Next Week – Week 03
Week 14
Week 04
• Control flow
○ statements
Week 03
○ conditions
• Data types
○ loops
• Dynamic typing
• Casting
To think
THANK YOU
ෙනාහැක්කක් ෙනාමැත.