Problem Set #0: Collaboration
Problem Set #0: Collaboration
Introduction
This problem set will introduce you to the programming environment IDLE and to programming in
Python, as well as to our general problem set structure. In this problem set, you will install IDLE, write a
simple Python program, and hand it in. Be sure to read this problem set thoroughly, especially the
sections of Collaboration and the Hand-in Procedure.
Collaboration
You may work with other students. However, each student should write up and hand in his or her
assignment separately. Be sure to indicate with whom you have worked. For further detail, please review
the collaboration policy as stated in the course information handout.
Problem 1
Write a program that does the following in order:
Asks the user to enter his/her date of birth.
Asks the user to enter his/her last name.
Prints out the users last name and date of birth, in that order.
An example of an interaction with your program is shown below (the words printed in blue are from the
computer, based on your commands, the words in black are a users input the colors are simply here to
help you distinguish the two components):
Enter your date of birth:
**01/26/32
Enter your last name:
**Grimson
Grimson 01/26/32
Hints:
To see how to use the print command, you may find it convenient to look at the input and output section
of the Python Wikibook. This will show you how to use print statements to print out values of strings.
To see how to read input from a users console into the Python environment, you may find it convenient
to look at the same section (see for example the raw_input or input function).
Remember that if you want to hold onto a value, you need to store it in a variable (i.e., give it a name to
which you can refer when you want that value). You may find it convenient to look at the variables and
strings section of the Python Wikibook.
Hand-In Procedure
1. Save
Save your code in ps0.py. Do not ignore this step or save your file(s) with different names.
3. Submit
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.