CMPT 120: Lab 1


Today's lab is a simple exercise to make sure you know how to use the Python interactive interpreter, write and save a simply Python program, and use the Submission Server. You will also get some practice with the print command. Remember that in these labs we want you to work with the people around you.

For more specific instructions for the first 2 steps you can look at section A.2 in the study guide appendix.

1. Start the Python IDLE. Using the interactive interpreter have Python print the string "Hello World"

2. Now open a new window, write the same line of code, and save it to file called HW.py. Run the program to make sure it works.

3. Now write a short program that assigns the value 3 to a variable, the value "CMPT 120" to a variable, and then prints the phrase "CMPT 120 is worth 3 credits." Use the two variables you created in the print statement. Save it to another file.

3. Next you are going to make sure you can use the submission server. This will be how you turn in your assignments electronically. The submission server only accepts zip files, so you are going to create a .zip file containing the two programs you just wrote. To create a .zip file, find the directory where the files are saved and select both files. If you right-click on one of the selected files, you should have the option to create an archive. Create a .zip file and give it any name you'd like.

4. Go to the Submission Server page at https://submit.cs.sfu.ca/ There is a link to this page from the course webpage. Your login is your sfu username (?@sfu.ca) and your initial password is your student id. The password for the submission server is the same password you use for Gradebook. If you used Gradebook or the submission server before, use your previous password. Follow the instructions on the page to submit your file.


Chris Schmidt, last updated May 15, 2007