Editing Community Data Science Course (Spring 2015)/Day 2 Lecture
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 11: | Line 11: | ||
* math: using python as a calculator | * math: using python as a calculator | ||
**addition, subtraction, multiplication, division | **addition, subtraction, multiplication, division | ||
**division shows something different: | **division shows something different: 8/2 versus 1/2 | ||
* <tt>type()</tt> | * <tt>type()</tt> | ||
** there are different types of things in python (called objects) | ** there are different types of things in python (called objects) | ||
Line 56: | Line 56: | ||
* accessing elements | * accessing elements | ||
** indexing like my_list[0] | ** indexing like my_list[0] | ||
** indexing starts from the front and we ''start counting at 0'' (now you understand all the zeros we've been using | ** indexing starts from the front and we ''start counting at 0'' (now you understand all the zeros we've been using | ||
** we go from the end with negative numbers | ** we go from the end with negative numbers | ||
** what happens if we try to move outside of the range? ('''error!'') | ** what happens if we try to move outside of the range? ('''error!'') |