Chapter 1: Everything is an object ====================================== .. code-block:: python # Chapter 1: Everything Is an Object # An integer object x = 10 # A string object y = "hello" # A list object z = [1, 2, 3] # A function object def greet(): return "Hi!" # Print values print("Values:") print(x) print(y) print(z) print(greet()) print("\nTypes:") print(type(x)) print(type(y)) print(type(z)) print(type(greet)) print("\nObject identities (memory locations):") print(id(x)) print(id(y)) print(id(z)) print(id(greet)) # Two variables referencing the same object a = 42 b = a print("\nSame object?") print(a == b) # Same value print(id(a) == id(b)) # Same object