You are on page 1of 28

Lab00

CS 111: Computer Science for Scientists


Dropbox
If you are working on a personal computer, download and
sign up for Dropbox now.
If you are working on a public computer, sign up for Dropbox
now and upload all of your work.
www.dropbox.com
Its free.
Its 2GB of storage that backs up automatically on the internet
Save everything (for every class) in your Dropbox folder!
Make sure you back up all of your files!
Apple: Public Computer
Apple: Public Computer
Apple: Public Computer
Apple: Public Computer
Windows: Private (Your) Computer
LET ME KNOW IF ANYTHING DEVIATES FROM THESE DIRECTIONS
Go to Internet and download
Python 3.5.2 for Windows
http://www.python.org/download/
DO NOT GET 2.7.12
If you dont know if your computer 32 or 64 bit come talk to me
PyCharm from Windows
https://www.jetbrains.com/pycharm-edu/download/
Install Python first and PyCharm Second.
Start PyCharm by selecting PyCharm from the Start-> All Programs menu
Create a folder CS111 wherever you want (Id recommend in the DropBox
folder)
Windows: Private (Your) Computer
Choose whatever you want for the Keyboard Shortcuts
and color scheme
Then hit ok
Apple: Private (Your) Computer
Go to Internet and download
Python 3.5.2 for Mac
http://www.python.org/download/
DO NOT GET 2.7.12
If you dont know if your computer 32 or 64 bit come talk to me
PyCharm from Mac
https://www.jetbrains.com/pycharm-edu/download/
Install Python before PyCharm
Apple: Private (Your) Computer
If you see this dialog box when installing Python,
control click on python.mpkg and then click open,
and then Open again.
Apple: Private (Your) Computer
Choose whatever you want for the Keyboard Shortcuts
and color scheme
Then hit ok
Create New Project
Click on Create new Project
Name your lab userid-lab00
Click on this box and navigate to your CS 111 folder
Create New Project
Choose the Python version with 3.5 (or 3.4) in it.
Create New Project
Click Install "distribute" if it appears it might not
look like it's doing anything. Just wait a few
seconds.
Create New Project
Click Create
New Python File
Right click (control click on Mac) on Lab00 and go to New
Python File
New Python File
Name the file HelloWorld
This is where you will write your code
Hello World
Write the line
print(hello world)
Whatever you put in quotes will be printed out!
Hello World
Right click (control click on Mac) on HelloWorld.py and click
Run HelloWorld
Notice
What you wrote should be printed out at the bottom.

You can also use the green arrow to run your code.
Print more phrases
Print out 4 more phrases!
Each phrase should be its own line
Each phrase should have its own print(statement)
I dont care what the phrases are.
Press play and have fun!
Write a Comment
You write comments using the # symbol
Everything on a line after # is ignored
Use a comment to say who wrote this code.
Write some more comments
Comments are there to help future-you read the code (and me
as well)
For now, just write a few comments to your program
Getting Input from the User
You can get input from the user by using the command
x=input(Please enter a phrase)
This will do three things:
Ask the user whatever you put in quotes.
Wait for the user to enter something (and press enter)
Store what the user input as a string in the variable x
You can change up whats in the or the name of the variable
if you like
Getting Input from the User
Ask the user to input a phrase, then print out whatever the
user entered
Hint: You can just copy this from the last slide!
Repeat the above step, except use a different variable and
change how you ask the user
Submitting the folder
Right click (control click for Mac)
on the project and click Reveal in
Finder (or Reveal in Explorer on
a PC)
Submitting the Folder
Right click on the folder to compress it
Mac: Compress Lab00
PC: Send To Compress
Open up Moodle and go to the Lab00 assignment and submit
Submitting
Drag your .zip file into this box

When finished, hit save changes


Yay! Youre done! (But, check with me first)

You might also like