Problem Set 1: helloworld
Web-CAT: Submit Python programs to this automated grading platform.
Background
- Due Date: Monday, September 9, 2019
- Total Points: 10
- This problem set introduces you to the write-run software development cycle, with a very simple code framework.
Code Distribution
| Description | File Size | File Name |
|---|---|---|
Python Source Code for helloworld |
1.1KB | pset01.zip |
Contents of pset01.zip:
PSet01SourceCode/
├── helloworld.py
└── testhelloworld.py
Specification
Using the Assignment Operator
-
Write a
Pythonprogram in the filehelloworld.pythat uses the assignment operator to assign the messagehello worldto thestringvariablegreetings. -
You will write your solution in a method called
displaymessage(), right below the place where it says:YOUR CODE HERE. Make sure that the phrasehello worldis placed in the variablegreetings. Save your code by using the keystroke combinationCtrl-s.
Executing your Python Program
- Now, you must run your
Pythonprogram. Click on theRunmenu item, and selectRun...

- Then, you should see the
Rundialog box appear. Select the file:helloworld

- The output of your program should appear in the
Consoleat the bottom of your window. You should see the wordshello worlddisplayed on the output.

Testing
-
Now, we are going to verify that we have a correct
Pythonprogram by using thePyUnittesting feature. -
In order to run the
PyUnittest bench, click on theRunmenu item, and selectRun...

- The
Rundialog box should appear. This time, select the file:testhelloworld

- You should then see the results of the
PyUnittest. Since this is an example of a successful test, the wordOKappears.

Submission
- Upload the file
helloworld.pyto the Web-CAT automated grading platform.