This introduction to the Python Programming Language is directed by Jason Cannon.
MP4s open in new window. You can also Right Click and Save Link As.
Install Python 3 on Mac by heading to python.org and downloading the latest Mac OS X stable version.
Install Python 3 on Windows by heading to python.org and downloading the latest Windows stable version.
For an OS not listed above please use this link to see if yours is supported.
Strings and Variables
Everthing in Python is an Object. Every Object has a Type. 'apple' is an Object of type "str". 'apple' is a String Object. fruit = 'apple'. Fruit is a String Object. Methods are Functions run against an Object. object.method❨❩
Numbers and Math
Boolean and Conditionals
The if statement evaluates to a boolean expression. If True, the associated code is executed. E.g. if 37 < 40 - Since boolean expression 37 less than 40 is True - print ('Thirty-seven is less than Forty.'); - if statement is executed.
History: Boolean Data Type
To sort a List call the sort list method on the list with out any arguements. This will re-order the current List. To create a new List use the built in sorted Function and supply a List as an arguement.
Tuples are immutable Lists. They Can Not be changed once defined. You can Add, Change or Remove the Values in normal Lists. Tuples you Can Not. Tuples like Lists are Ordered and Values in the Tuples are accessed by Index.
If you want to keep data generated by a program you need a place to store it. Files are great for storage that lasts beyond the execution of a program. To retrieve that data you will need to use certain techniques.
Python has a large library of Modules. Before writing your own code it best to look through the Python Standard Library. Modules like CSV, logging, urllib.request, and json have already been established to save you from trying to reinvent the wheel.
Infographic: Common Python Mistakes