|
| 1 | +.. _session_1_02: |
| 2 | + |
| 3 | +##################################### |
| 4 | +Session 2: Basic Python and Functions |
| 5 | +##################################### |
| 6 | + |
| 7 | +**Basic Python and Functions** |
| 8 | + |
| 9 | +Pre-class prep |
| 10 | +============== |
| 11 | + |
| 12 | +Dev environment |
| 13 | +--------------- |
| 14 | + |
| 15 | +Make sure you know how to create a python file, save it, edit it, run it, etc. |
| 16 | + |
| 17 | +Also make sure you are comfortable "playing" with python in the iPython command line. |
| 18 | + |
| 19 | +If you are uncomfortable with the command line, brush up on that: `This: <https://learnpythonthehardway.org/python3/appendixa.html>`_ is a good tutorial. |
| 20 | + |
| 21 | +Python |
| 22 | +------ |
| 23 | + |
| 24 | +Python Tutorial |
| 25 | +............... |
| 26 | + |
| 27 | +Tutorials come in many forms, but I define a python "tutorial" as a quick high-level introduction, designed to kick start your python programming. It should give you enough to get something done, but not provide a lot of detailed explanations. If you have been doing a bit of python coding already, or have taken an introductory programing class with Python, then you may be able to skip this step. |
| 28 | + |
| 29 | +Every one of you has a different background and learning style. So take a bit of time to figure out which resource works for you. |
| 30 | + |
| 31 | +:ref:`python_learning_resources` |
| 32 | + |
| 33 | +Provides some options. Do look it over. |
| 34 | + |
| 35 | +Python Basics |
| 36 | +------------- |
| 37 | + |
| 38 | +If you are comfortable with the materials in a tutorial, it's time for some more in-depth discussion. Here are a few options to get you started this week: |
| 39 | + |
| 40 | +Finish Reading: :ref:`basic_python_syntax` |
| 41 | + |
| 42 | +Read: :ref:`more_on_functions` |
| 43 | + |
| 44 | +Read: :ref:`documentation` |
| 45 | + |
| 46 | +Supplimental Reading |
| 47 | +-------------------- |
| 48 | + |
| 49 | +If that is too fast, then here are some good options for another look: |
| 50 | + |
| 51 | +*Think Python:* Chapters 1–6 (http://greenteapress.com/thinkpython2/html/index.html) |
| 52 | + |
| 53 | +*Dive Into Python:* Chapters 1–2 (http://www.diveintopython3.net/) |
| 54 | + |
| 55 | +*LPTHW:* ex. 1–10, 18-21 (https://learnpythonthehardway.org/python3/) |
| 56 | + |
| 57 | +(note: LPTHW used to be totally free --now it looks like you may only get a sneak peak -- darn! -- but the first few "chapters" are available) |
| 58 | + |
| 59 | +**GOAL** |
| 60 | + |
| 61 | +You should be comfortable with working with variables, numbers, strings, |
| 62 | +and basic functions before we start class next week. |
| 63 | + |
| 64 | + |
| 65 | +git |
| 66 | +--- |
| 67 | + |
| 68 | +We are only using a small subset of git functionality for this class, |
| 69 | +but if you feel lost, and/or want to know more, these are some good resources: |
| 70 | + |
| 71 | +http://rogerdudler.github.io/git-guide/ |
| 72 | + |
| 73 | +or |
| 74 | + |
| 75 | +https://try.github.io/ |
| 76 | + |
| 77 | + |
| 78 | +In-class Activities |
| 79 | +=================== |
| 80 | + |
| 81 | + |
| 82 | +Review :ref:`python_pushups` |
| 83 | + |
| 84 | +Exercises: |
| 85 | +---------- |
| 86 | + |
| 87 | +:ref:`exercise_grid_printer` |
| 88 | + |
| 89 | +:ref:`exercise_fizz_buzz` |
| 90 | + |
| 91 | +:ref:`exercise_fibonacci` |
| 92 | + |
| 93 | + |
| 94 | +Post-class Activities |
| 95 | +===================== |
| 96 | + |
| 97 | + |
| 98 | +Finish the Exercises |
| 99 | + |
| 100 | +Look at the next session for reading, etc: |
| 101 | + |
| 102 | +:ref:`session_1_03` |
| 103 | + |
0 commit comments