Skip to content
Learnearn.uk » Home » Records

Records

Records

Records

Records are composite data types that contain references to at least 1 other datatype within them. The advantage of records is that all related data is tied together in one place. They are incredibly useful and popular in many languages.

#Works for Python 3.3+

import types

giraffe = types.SimpleNamespace()

giraffe.name = "Gerry"
giraffe.height = 350
giraffe.age = 15
giraffe.origin = "Africa"