LEGB principle
LEGB principle
Sometimes, using string substitution the code can become unreadable when you are using many substitutions, for example imagine this:
String substitution is an efficient way to substitute variables into a string, lets take the example below:
Lets say we want to do the following:
Some example code to quickly create a sample UI window in Maya.
Remember running this from within Maya:
Functions within our python scripts are created using the ‘def’ command:
Output: I am a pug Note that the whatbreed() class has been added to the subclass Dog() but is not present in the base class…
Lets say we have a simple animal class:
‘self’ lets us refer to an instance of a class, Let’s modify our previous Animal class example: