Community Data Science Course/Day 1 Exercise: Difference between revisions
(→Goal #7: Practice Python using Codecademy: bump version link) |
(→Goal #8: Checkoff: update dead link) |
||
Line 81: | Line 81: | ||
* 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. | * 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. | * 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 [[ | * Walk through the Tutorial concept that was most confusing for you. The Tutorial is [[Community_Data_Science_Course/Day_1_Tutorial|here]]. | ||
* Walk through the Codecademy problem that you had the most difficulty with. The Friday Codecademy questions are [http://www.codecademy.com/courses/python-beginner-en-kSQwt here]. | * Walk through the Codecademy problem that you had the most difficulty with. The Friday Codecademy questions are [http://www.codecademy.com/courses/python-beginner-en-kSQwt here]. | ||
Revision as of 02:18, 31 March 2019
For the exercises tonight, please do the following things:
- 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!
- When you've finished all of the goals, raise your hand and I will come over and go through a checklist with you to make sure you're all set for next week.
Please be sure to do the checkoff before you leave — it'll make sure that you are in good shape for next week.
Goal #1: Set up Python
(Estimated time: 5 minutes)
First things first: We need to install the Python programming language. Please complete the instructions below for your operating system:
Goal #2: Prepare a text editor
(Estimated time: 5 minutes)
In addition to being able to run Python, we are going to install a good text editor for writing and saving Python code during the workshop.
In this course, I will use VSCode, which is free and open source. You are free to use a different editor than this, but it must be a programming oriented editor: I strongly do not recommend notepad.exe.
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:
(Estimated time: 10 - 15 minutes)
Throughout this course, 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.
Goal #5: Practice running Python code from a file
(Estimated time: 5 minutes)
Interactive Python programming at a Python prompt is great for short pieces of code and for testing ideas. For longer code, it can be easier to save the code in a file, and execute the contents of that file (aka a Python script). In this section, we'll practice running Python scripts.
Goal #6: Start learning Python!
(Estimated time: 60 - 90 minutes)
It's time to start learning, reading, and writing some Python! Tonight, you'll work through a self-directed tutorial. Next week, we'll have an interactive lecture to cover more Python basics.
Goal #7: Practice Python using Codecademy
(Estimated time: 30 - 60 minutes)
It's time to use what we've learned in the tutorial and get some practice thinking about and solving problems in Python.
To give you this practice, we've created custom online practice problems just for this class, using a site called Codecademy!
Tonight, please visit the link below and complete the 8 practice problems in the "Strings and choices" section. Go ahead and skip problem #4 ("Make HTML"). It's not a problem if you do it but we find that it's confusing and we'd prefer to skip it this time.
You don't have to create a Codecademy account to do the exercises, but if you do create an account it'll keep track of which problems you've completed and other statistics.
Goal #8: Checkoff
Tell Tommy that you are ready to be checked off. Together you will go through the following check-off steps:
- 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:
print("Hello World")
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 here.
- Walk through the Codecademy problem that you had the most difficulty with. The Friday Codecademy questions are here.
If you have any other questions about the tutorial, project setup, or Codecademy questions, now is a great time to ask!
Congratulations!
You are done with the first class in this series!