Editing Intro to Programming and Data Science (Summer 2020)/Day 1 Coding Challenge

From CommunityData

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
Our goal is to get your computer set up with the software you will need for this course and to get started with some basic programming concepts.
Our goal is to get your computer set up with the software you will need for this course and to get started with some basic programming concepts.


* Start your laptop and get on the wireless network.
* Work through the goals on this page in order; they should take around 2 hours. I will help troubleshoot and answer questions — don't hesitate to ask!
* Work through the goals on this page in order; they should take around 2 hours. I will help troubleshoot and answer questions — don't hesitate to ask!
* When you've finished all of the goals, raise your hand and I will come over and go through the checklist with you to make sure everything is working.


== Goal #1: Set up Python and make a class folder ==
== Goal #1: Set up Python ==


(Estimated time: 5 minutes)
(Estimated time: 5 minutes)
Line 12: Line 14:
* [[OSX set up Python (Anaconda)|OS X]]
* [[OSX set up Python (Anaconda)|OS X]]


* Go ahead and make a folder to use for your class files. A dedicated folder will help you keep track of all the items you download or write as part of the class, and make them easier to find later. One of the secrets of data science is being kind to your future self by being extremely organized.
== Goal #2: Get a text editor ==


== Goal #2: Practice running Python code from an existing Jupyter notebook ==
(Estimated time: 5 minutes)
 
It is pretty rare for non-programmers to edit plain text files directly and so Notepad (for Windows) or TextEdit (for Mac) is likely all that you've ever used or needed.
 
Because programmers work with text files all day, they have built many, many text editors and have [https://en.wikipedia.org/wiki/Editor_war very strong feelings] about the merits of their preferred editor and the weaknesses of competitors.
 
I am not immune from this human failing, and I'm happy to talk at length about [https://en.wikipedia.org/wiki/Vim_(text_editor) my preferred editor]. However, in this course I will use a simpler editor called [https://atom.io/ Atom], which is free and open source. I highly recommend that you also use Atom. If you want to use something else, then talk to me about it.
 
For this goal, go to [https://atom.io/ the Atom site] and download and install it.
 
== Goal #3: Practice starting and exiting Python ==
 
(Estimated time: 5 minutes)
 
We'll do a lot of learning and practicing at a Python prompt (this is "interactive" because you are typing the code and hitting enter to run it yourself, instead of running it from a file). So let's practice starting and exiting Python:
 
* [[Windows interactive Python|Windows]]
* [[OSX interactive Python|OS X]]
 
== Goal #4: Practice navigating the computer from a terminal ==
 
(Estimated time: 10 - 15 minutes)
 
In addition to interactively running code, we'll also be writing whole programs and running them from the terminal. This 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.
 
* [[Windows terminal navigation|Windows]]
* [[OSX terminal navigation|OS X]]
 
== Goal #5: Practice running Python code from a file ==


(Estimated time: 5 minutes)
(Estimated time: 5 minutes)


We're going to use Jupyter notebooks to write and run Python throughout the class.  By installing Anaconda, you can now use your computer's web browser to write and run python code files on your computer. Jupyter notebooks can mix together text and code. You can make changes and immediately see what happens. In this section of the setup process, we'll try out your Python setup by running code in an existing notebook.
Now that you know how to get to a file in the terminal, in this section, we'll practice running Python scripts.
<div style="font-size:125%">[[Python in Jupyter |  &raquo; Click here to get started with Python in Jupyter &laquo;]]</div>


* [[Windows Python scripts|Windows]]
* [[OSX Python scripts|OS X]]


== Goal #3: Start learning Python! ==
== Goal #6: Start learning Python! ==


(Estimated time: 60 - 90 minutes)
(Estimated time: 60 - 90 minutes)
Line 30: Line 61:
[[Intro To Programming and Data Science (Spring 2020)/Day 1 Tutorial|Day 1 Tutorial]]
[[Intro To Programming and Data Science (Spring 2020)/Day 1 Tutorial|Day 1 Tutorial]]


== Goal #5: Practice Python using LearnPython ==
== Goal #7: Practice Python using DataCamp ==


(Estimated time: 30 - 60 minutes)
(Estimated time: 30 - 60 minutes)
Line 36: Line 67:
It's time to use what we've learned in the tutorial and get some practice thinking about and solving problems in Python.
It's time to use what we've learned in the tutorial and get some practice thinking about and solving problems in Python.


<div style="font-size:125%">[https://learnpython.org/ &raquo; Click here and complete the first two lessons on Learnpython &laquo;]</div>
The online code learning site [https://www.datacamp.com/ DataCamp] has been kind enough to make their materials available to our class. You should have received an invitation to our DataCamp class site. This will let you see assignment and work on exercises in DataCamp. If you haven't yet done so, then find the email, create an account, and log in.
 
For tonight (and the rest of this week), work on the assignment in DataCamp.
 
== Goal #8: Checkoff ==
 
Tell me that you are ready to be checked off. Together we will go through the following check-off steps:


Your next task is to work through '''the first two lessons''' (there are ''many'' lessons, so don't just keep hit "Next" or you're never finish!):
* Start a terminal prompt, and from that prompt start Python. Then quit Python.
* Create a new Python file (with a .py extension). In that file, type: <code>print("Hello World")</code> and then Enter and save the file. From a terminal prompt, navigate to and execute that Python script.
* Open your text editor, and press "Tab". Use the left arrow key to show the instructor that you are using spaces to indent, not tabs.
* Walk through the Tutorial concept that was most confusing for you. The Tutorial is [[Intro To Programming and Data Science (Spring 2020)/Day 1 Tutorial|Day 1 Tutorial]].
* Walk through the DataCamp problem that you had the most difficulty with.


* [https://www.learnpython.org/en/Hello%2C_World%21 Hello, World]
If you have any other questions about the tutorial, project setup, or Datacamp questions, now is a great time to ask!
* [https://www.learnpython.org/en/Variables_and_Types Variables and Types]


<!-- If you feel adventurous, go ahead and learn about lists -- they'll be really useful later! -->
==Congratulations!==


You may find the LearnPython interface is different from your Jupyter Notebook. No worries, it's still Python, even though it looks a bit different. You could do these lessons in Jupyter Notebook by copying & pasting the code in the left-hand boxes from LearnPython into Jupyter Notebook cells and run them from Jupyter.
You are done with the first class in this series!
Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see CommunityData:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)