

Python for Pork Chops#
About
The Pork Chop pages are intended to help people coming into Cobalt from a bridge background who are not experienced Django developers. They are NOT required reading for Django developers.
Do a course. Learn some basic things but don’t get stressed about the advanced things, you will learn them when you need them.
A lot of python developers work in data science so try not to go down a rabbit warren of things you don’t need to know as a Django developer.
Key Things to Learn#
- Basic Structure
No brackets, no endifs, no endfors, indentation is king
- Everything is an Object
You can use dir(my_variable) to see what something can do
- Functions or Classes, You Choose
Both functional and OO programming are equal partners, use what is right for the problem you are solving. If you have a bunch of related things then classes are probably the solution, if you every write a class with only one or two methods, it should probably be a function. Classes have overhead, functions don’t.
- Data Structures
You need to understand things that can be changes and things that can’t. Posh term is mutable and imputable. You need to understand lists, tuples and more complex structures.
- Packages
Python packages are pretty good (awesome if you haven’t seen this in other languages). Before you build something, check if someone else has already done it.