ledatascifi-2022/handouts/Python exercises.ipynb
ledatascifi-2022/content/01/06_python.ipynb
Hopefully this goes better than Chrissy Teigen's experience with Py:
classmates-2022
posts: You should be receiving them as emails. Let me/Julio know ASAP if not!Homework tips
Cover much of 1.7.2's python essentials:
And debugging, good practices, and maybe how to gitignore files.
After this assignment, we can start considering much more interesting challenges!
Big points:
instructions/instructions.md
file! Everything there is graded, as this assignment covers the basic skills we use throughoutTips:
Remember to use comments! In fact, over use them in the beginning.
They help you, future you, and others understand what
Else, you'll find yourself in this photo soon:
Remember to use comments! In fact, over use them in the beginning.
They help you, future you, and others understand what
More (advanced) thoughts in Chapter 2.7
We will run parts of the textbook file in our open notes file.
TIP: Copy this table from the textbook into your Module notes!
Listed from most commonly used to least:
Type Name | Example | Description |
---|---|---|
list | [1, 2, 3] | Ordered collection |
dict | {'a':1, 'b':2, 'c':3} | Unordered (key,value) mapping |
set | {1, 2, 3} | Unordered collection of unique values |
tuple | (1, 2, 3) | Immutable ordered collection |
L=[8, 5, 6, 3, 7]
L[0]
returns 8, L[1]
returns 5L[-1]
returns 7, L[-2]
returns 3L[<start at index> : <go till index>]
L[0:3]
and L[:3]
return [8,5,6]
L[-3:]
returns [6,3,7]
python exercises.ipynb
now!TIP: This is also how you save assignment work to github!
And at the end of each working session (i.e. class or doing homework),