Previous Lecture | Lecture 2 | Next Lecture |
Lecture 2, Thu 04/04
Python Review cont'd
Plan for today
- work through the provided handout (included in the slides folder)
- review Python Basics needed for this course
Related textbook section: Getting Started with Data
- Python Basics
- Types
- int, float, boolean, strings, lists, sets, dictionaries,…
- conversion functions (
int(), float(), str()
, …)
- Mutable vs. Immutable
- Has an effect on parameters passed into functions
- Relational / Logical operators (
==, <, <=, >, >=, and, or, not
, …) - Python Lists
- supporting methods (
count()
,pop()
, …) - Understanding under-the-hood functionality of dictionaries vs lists
- supporting methods (
- List / string slicing
[:]
- Strings
- supporting methods (
replace()
,split()
,find()
, …)
- supporting methods (
- Function definitions
- Control structures
if, else, elif
- Loops
for
(relies onrange()
; helpful withenumerate()
),while
- Types