Description
Handed out: Lecture 1.
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
Installing Python and IDLE
Follow the steps in Getting Python for installing Python and IDLE onto the machine you plan to be using this term.
Familiarize yourself with Python and IDLE using the exercises given in the handout. Once you are ready, proceed to the programming part of this assignment.
Note, when you first start using your system, make sure that the version number displayed is not 3.0 or higher. That version of Python is not backwards compatible with 2.5.4, which is the official Python version used in this course.
A Very Simple Program: Entering and Printing Your Name
The goal of this programming exercise is simply to get you more comfortable with using IDLE, and to begin using simple elements of Python. Standard elements of a program include the ability to print out results (using the print operation), the ability to read input from a user at the console (for example using the raw_input or input function), and the ability to store values in a variable, so that the program can access that value as needed.
Problem 1
Write a program that does the following in order:
Asks the user to enter his/her last name.
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 user’s input – the colors are simply here to help you distinguish the two components):
**01/26/32
Enter your last name:
**Grimson Grimson 01/26/32 Hints:
Hand-In Procedure
1. Save
Save your code in ps0.py. Do not ignore this step or save your file(s) with different names.
2. Time and Collaboration Info
At the start of each file, in a comment, write down the number of hours (roughly) you spent on the problems in that part, and the names of the people you collaborated with.
For example:
# Problem Set 0
# Name: Jane Lee
… your code goes here …
3. Submit
MIT OpenCourseWare
http://ocw.mit.edu
6.00SC Introduction to Computer Science and Programming
Spring 2011
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.




Reviews
There are no reviews yet.