print(rec namebob this code has substantially less syntax than the dictionary equivalent it uses an empty class statement to generate an empty namespace object once we make the empty classwe fill it out by assigning class attributes over timeas before this worksbut new class statement will be required for each distinct record we will need perhaps more typicallywe can instead generate instances of an empty class to represent each distinct entityclass recpass pers rec(pers name 'bobpers jobs ['dev''mgr'pers age pers rec(pers name 'suepers jobs ['dev''cto'pers namepers name ('bob''sue'instance-based records herewe make two records from the same class instances start out life emptyjust like classes we then fill in the records by assigning to attributes this timethoughthere are two separate objectsand hence two separate name attributes in factinstances of the same class don' even have to have the same set of attribute namesin this exampleone has unique age name instances really are distinct namespacesso each has distinct attribute dictionary although they are normally filled out consistently by class' methodsthey are more flexible than you might expect finallywe might instead code more full-blown class to implement the record and its processing--something that data-oriented dictionaries do not directly supportclass persondef __init__(selfnamejobsage=none)self name name self jobs jobs self age age def info(self)return (self nameself jobsrec person('bob'['dev''mgr'] rec person('sue'['dev''cto']rec jobsrec info((['dev''mgr']('sue'['dev''cto'])class data logic construction calls attributes methods this scheme also makes multiple instancesbut the class is not empty this timewe've added logic (methodsto initialize instances at construction time and collect attributes the world' simplest python class