Home » 2016 (Page 4)

Pythonlearn:resources-week10

Lecture Notes Tuples Tuples are a sequence that behave much like a list, except: Tuples are immutable (cannot be altered) displayed surrounded by parentheses ‘(,)’ rather than brackets ‘[,]’ surrounding by parenthesis is just visual help; Comma is what makes tuple type cannot sort, append, reverse, reorder, etc...
Continue reading

Pythonlearn:resources-week09

Lecture Notes Examples below come from Chapter 9 Video List – a linear collection of ordered values. Dictionary – an assortment of unordered labeled values, similar to a database Dictionaries Different names for Dictionaries: Associative Arrays – Perl/Php Properties of Map or HashMap – Java Property Bag –...
Continue reading

Pythonlearn:resources-week08

Lecture Notes Lists Collection – allows us to put many values in a single variable. Simple variables are not collections. The previous value is overwritten when changed. A List is made up of list ‘constants’. Lists are surrounded by square brackets [] and the constants in the list...
Continue reading

Pythonlearn:resources-week07

Lecture Notes Working with files Before Python can access file information it must “open” the file. open() is the built-in function which tells Python to open the file. open() takes two parameters ‘filename’ and ‘mode’. If you leave the second parameter off ‘open(filename)’ Python will simply open the...
Continue reading

Pythonlearn:resources-week06

Lecture Notes: Strings A string is a series of alphanumeric characters in a character data type. A string is defined by grouping series of character with single or double quotes. A plus sign (+) is used to concatenate multiple character strings. A numeric string is still alphanumeric characters...
Continue reading

Pythonlearn:resources-week05

Lecture Notes “is” and “is not” Operators “is” can be used in logical expressions. It implies ‘is exactly the same instance, type and value’. Whereas ‘==’ compares two items and will declare the comparison as ‘True’ if the items are the same type and have the same physical...
Continue reading

Pythonlearn:resources-week04

Lecture Notes – Functions Programmers tend to write a lot of code, sometimes writing intricately nested conditionals and plugging in variables into complex formulas just to calculate one value or derive one output. However, repeating those several lines of code over and over again for every time the...
Continue reading

Pythonlearn:resources-week03

Lecture Notes – Conditional Execution Visualize python great tool for beginners Stanley Canning a few seconds ago I would really recommend students to use the visualizer that can be found at http://www.pythontutor.com/visualize.html#mode=edit It goes through each line of code line by line and points out where you have...
Continue reading