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
Python
program in the filehelloworld.py
that uses the assignment operator to assign the messagehello world
to thestring
variablegreetings
. -
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 world
is placed in the variablegreetings
. Save your code by using the keystroke combinationCtrl-s
.
Executing your Python
Program
- Now, you must run your
Python
program. Click on theRun
menu item, and selectRun...
- Then, you should see the
Run
dialog box appear. Select the file:helloworld
- The output of your program should appear in the
Console
at the bottom of your window. You should see the wordshello world
displayed on the output.
Testing
-
Now, we are going to verify that we have a correct
Python
program by using thePyUnit
testing feature. -
In order to run the
PyUnit
test bench, click on theRun
menu item, and selectRun...
- The
Run
dialog box should appear. This time, select the file:testhelloworld
- You should then see the results of the
PyUnit
test. Since this is an example of a successful test, the wordOK
appears.
Submission
- Upload the file
helloworld.py
to the Web-CAT automated grading platform.