Session 2: Basic Python and Functions

Basic Python and Functions

Pre-class prep

Dev environment

Make sure you know how to create a python file, save it, edit it, run it, etc.

Also make sure you are comfortable “playing” with python in the iPython command line.

If you are uncomfortable with the command line, brush up on that: This: is a good tutorial.

Python

Python Tutorial

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.

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.

Useful Python Learning Resources

Provides some options. Do look it over.

Python Basics

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:

Finish Reading: Basic Python

Read: More on Functions

Read: Documentation

Supplimental Reading

If that is too fast, then here are some good options for another look:

Think Python: Chapters 1–6 (http://greenteapress.com/thinkpython2/html/index.html)

Dive Into Python: Chapters 1–2 (http://www.diveintopython3.net/)

LPTHW: ex. 1–10, 18-21 (https://learnpythonthehardway.org/python3/)

(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)

GOAL

You should be comfortable with working with variables, numbers, strings, and basic functions before we start class next week.

git

We are only using a small subset of git functionality for this class, but if you feel lost, and/or want to know more, these are some good resources:

http://rogerdudler.github.io/git-guide/

or

https://try.github.io/

Post-class Activities

Finish the Exercises

Look at the next session for reading, etc:

Session 3: Booleans, Sequences, Iteration, and Strings