Skillshare intro to Python/Unit 1: Difference between revisions

From OpenHatch wiki
Content added Content deleted
imported>Jesstess
imported>Jesstess
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Goal #1: set up Python ==
== Goal #1: set up Python ==

(Estimated completion time: 2 - 10 minutes)


First things first: we need to install Python! Please complete the instructions below for your operating system.
First things first: we need to install Python! Please complete the instructions below for your operating system.
Line 8: Line 10:


== Goal #2: install a text editor ==
== Goal #2: install a text editor ==

(Estimated completion time: 2 - 10 minutes)


In addition to being able to run Python, we are going to install a good text editor for writing Python code.
In addition to being able to run Python, we are going to install a good text editor for writing Python code.
Line 18: Line 22:


== Goal #3: practice terminal navigation ==
== Goal #3: practice terminal navigation ==

(Estimated completion time: 10 - 15 minutes)


Throughout this class, we'll be running Python programs from the terminal, which means we'll want to be comfortable with navigating to those programs from the terminal prompt. In this section, we'll practice using these navigation commands.
Throughout this class, we'll be running Python programs from the terminal, which means we'll want to be comfortable with navigating to those programs from the terminal prompt. In this section, we'll practice using these navigation commands.
Line 25: Line 31:
* [[Skillshare intro to Python/Unit 1/Linux terminal navigation|Linux]]
* [[Skillshare intro to Python/Unit 1/Linux terminal navigation|Linux]]


==Success!==
== Goal #4: reading and running Python files ==

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

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

<ol>
<li>Download the script and save it to your Desktop. Be sure to save it as a <code>.py</code> file.</li>
<li>Open the script in your text editor.</li>
<li>Read through the script. Don't worry about understanding every last detail. Instead focus on:

<ul>
<li>Overall, what does this script do?</li>
<li>What variables and data types are used? Where are the strings, integers, and floats?</li>
<li>What functions are used, and why?</li>
<li>Where are the comments, and what do they tell you?</li>
</ul>
</li>
<li>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?</li>
<li>Think about one way that you could extend the script to make it more useful. How would you make that change in code?</li>
</ol>


You've set up your programming environment, gotten comfortable with Python, and are a terminal pro. Keep practicing!
<b>Here are you scripts to read and run</b>. Have fun with them!


[[File:Champagne.png|100px]][[File:Party.png|125px]]
* [http://web.mit.edu/jesstess/www/SkillsharePython/Unit1/nobel.py nobel.py] (this is the script we analyzed in the video)
* [http://web.mit.edu/jesstess/www/SkillsharePython/Unit1/tip_calculator.py tip_calculator.py]
* [http://web.mit.edu/jesstess/www/SkillsharePython/Unit1/pizza_calculator.py pizza_calculator.py]

Latest revision as of 00:05, 14 June 2013

Goal #1: set up Python

(Estimated completion time: 2 - 10 minutes)

First things first: we need to install Python! Please complete the instructions below for your operating system.

Goal #2: install a text editor

(Estimated completion time: 2 - 10 minutes)

In addition to being able to run Python, we are going to install a good text editor for writing Python code.

If you would like to use a different text editor from the recommendation for your operating system, great! Just let me know so I can confirm that it'll work for this class.

Goal #3: practice terminal navigation

(Estimated completion time: 10 - 15 minutes)

Throughout this class, we'll be running Python programs from the terminal, which means we'll want to be comfortable with navigating to those programs from the terminal prompt. In this section, we'll practice using these navigation commands.

Success!

You've set up your programming environment, gotten comfortable with Python, and are a terminal pro. Keep practicing!