Difference between revisions of "Skillshare intro to Python/Unit 2"

From OpenHatch wiki
Jump to navigation Jump to search
imported>Jesstess
imported>Jesstess
Line 39: Line 39:
 
<ol>
 
<ol>
 
<li>Create an account on http://codecademy.com</li>
 
<li>Create an account on http://codecademy.com</li>
<li>Visit http://www.codecademy.com/courses/50fdd9c0e62630786700135d and complete the 8 exercises in Section 1: <b>Strings and choices</b></li>
+
<li>Visit http://www.codecademy.com/courses/python-beginner-en-kSQwt/0/ and complete the 8 exercises in this section, <b>Strings and choices</b></li>
 
</ol>
 
</ol>
 
  
 
== Goal #3: Codecademy practice part 2: lists and loops ==
 
== Goal #3: Codecademy practice part 2: lists and loops ==

Revision as of 01:09, 13 June 2013

Goal #1: practice reading and running Python files

We'll be practicing two skills with this goal. The first is reading and understanding Python programs. The second is running these programs from the terminal.

For each of the following Python programs (folks often call these "scripts"), please do the following:

  1. Download the script and save it to your Desktop. Be sure to save it as a .py file.
  2. Open the script in your text editor.
  3. Read through the script. Don't worry about understanding every last detail. Instead focus on:
    • Overall, what does this script do?
    • What variables and data types are used? Where are the strings, integers, and floats?
    • What functions are used, and why?
    • Where are the comments, and what do they tell you?
  4. Once you have a good sense of what the script does, open a terminal, navigate to the directory where you saved the script, and run it. Does it do what you expected?
  5. Think about one way that you could extend the script to make it more useful. How would you make that change in code?

Here are you scripts to read and run. Have fun with them!


Goal #2: Codecademy practice

Let's get some practice thinking like programmers: breaking down problems and solving them in code using the Python tools that we've learned so far.

To help you practice, we've written some custom Python questions for this course using the Codecademy framework. We use Codecademy because you can do the exercises online from any computer, you can easily save your progress and check on old solutions as you go along, and we can give you detailed hints as you work through the problems.

So let's get started! Please:

  1. Create an account on http://codecademy.com
  2. Visit http://www.codecademy.com/courses/python-beginner-en-kSQwt/0/ and complete the 8 exercises in this section, Strings and choices

Goal #3: Codecademy practice part 2: lists and loops

It takes practice to get the hang of and develop an intuition for how to uses lists and loops. So let's practice! We've created

So let's get started! Please:

  1. Create an account on http://codecademy.com
  2. Visit http://www.codecademy.com/courses/python-beginner-en-kSQwt/1/ and complete the 11 exercises in this section, Lists and loops