Assessments
- Only 3 labs are assessed
- Rest are for practice
Memory Model
See: Memory
Objects in Python
- Python is an object-oriented language
- Classes are the basis for all data types
e.g.int, float, strare inbuilt classes
- Classes are the basis for all data types
- Given
temperature = 98.6:-
temperature-> reference to object -
98.6-> object of classfloat
-
- Now if we add
original = temperature:- We create another reference (also called an alias) for this object

- We create another reference (also called an alias) for this object
Class is the blueprint and object is a specific instance
Every class like float and int has methods that can be used to manipulate the values of the object
Constructor is a method to create an object of a specific class
- i.e. instead of
t = 98.6-> we can writet = float(98.6) - Constructor has same name as class
If an object has no reference, it is unusable and in Python, a background program will clear the object from memory to free up space