Anything can be a list


  • Comma separated values
  • In square brackets
  • Can be any value, and a mix of values: Integer, Float, Boolean, None, String, List, Dictionary, ...
  • But usually they are of the same type:
  • Distances of astronomical objects
  • Chemical Formulas
  • Filenames
  • Names of devices
  • Objects describing attributes of a network device.
  • Actions to do on your data.


examples/lists/any_list.py

stuff = [42, 3.14, True, None, "Foo Bar", ['another', 'list'], {'a': 'Dictionary', 'language' : 'Python'}]
print(stuff)
[42, 3.14, True, None, 'Foo Bar', ['another', 'list'], {'a': 'Dictionary', 'language': 'Python'}]