Description
2 Requirements
Please complete the following:
1
1. Install Python 3.7.4, the latest version of Python. You can download Python 3 directly at https:
//www.python.org/downloads/. When asked to make a choice, install 64-bit Python, and make
sure you check YES in the little checkbox that asks whether you want to add Python to the PATH.
2. When installation is complete, ensure you can access Python 3 by using the commands python and
python3 on the command line (Windows) or Terminal (macOS). Which one works for you?
3. Open the Windows File Explorer (Windows) or Finder (macOS) and navigate to the folder where
Python was installed. Can you find it?
4. Sign up for a free renewable one-year JetBrains student license at https://www.jetbrains.com/
student/ so you can download and use any of the JetBrains desktop products.
5. Download and install the JetBrains Python IDE called PyCharm on your laptop. Visit https://www.
jetbrains.com/help/pycharm/install-and-set-up-pycharm.html#installation-requirements
for some helpful instructions.
6. When you start PyCharm for the first time, you will be asked to choose some settings. You can modify
any decisions you make, so don’t worry, you can’t break it.
7. PyCharm organizes our code into projects. Everything is done within the context of a project.
8. Create a new project called HelloWorld.
9. Python best practice is to create a virtualenv for each project, but we won’t do that in COMP 1510
because it’s only necessary for larger software projects. To avoid this, expand the Project Interpreter
node. Let’s choose Existing interpreter, and and specify the location of our Python installation.
Figure 2: Choose “Existing interpreter”
10. Check out the Code Tool Tips Window that PyCharm opens. These are useful. I strongly encourage
you to read each one.
2
11. Examine the files that are generated when we create this project. In the Project View (upper left
window) we can see the project files. There is a text editor window on the right, and a Tools Window
(hidden right now) at the bottom.
12. In the Project Windows in the upper left corner of PyCharm, right-click the little grey folder that has
your project name and choose New | Python file. Call it HelloWorld and press okay. PyCharm will
create the file and open it in the editor window.
13. Add some code to print Hello, world! to the screen.
14. Execute (run) the program by choosing Run/Run on the main menu. If a configuration window
pops up, click 1. HelloWorld. Check out the output that appears in the Run window at the bottom
of PyCharm. You can select configuration and play with the controls. You can’t break it!
15. Inside the same project, create a new file (program) called Temperature. Inside the Temperature
file, declare and initialize a variable to store a temperature in degrees celsius. Store 10 degrees
celsius. Use an expression and an assignment to convert this temperature to Fahrenheit and store it
in a new variable that stores temperatures in degrees Fahrenreit. Print the original and calculated
temperatures in a way that is easy for someone to read.
16. Create a new program (file) called Poem. Print the following message to the console (screen):
Roses are red
Violets are blue
Sugar is sweet
But I have commitment issues
So I’d rather just be friends
At this point in our relationship.
17. Which of the following assignments statements are valid?
x = 1
x = y
x = y + 2
x + 1 = 3
x + y = y + x
18. Bonus point: I like bonuses. I like encouraging you to work hard and do extra things that will make
you a better developer. To earn an extra point for this lab, add/commit this lab to a git repository on
your local machine (what we call your laptop), and then push it in a private repository on GitHub.
Let me know you’ve done this by inviting me on GitHub as a collaborator to your private repository.
On GitHub I am known as chris-thompson, and you will recognize me by my avatar.
That’s it! Good luck, and have fun!
3