Home / Problem Sets / Problem Set 0

Problem Set 0: Introduction & Installation

The questions below are due on Friday April 05, 2024; 09:00:00 PM.
 
You are not logged in.

If you are a current student, please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.

  • If you finished 6.100A this semester, you do not need to complete this pset.

Download Files

1) Background Survey

What is your Grade Level?
Freshman
Sophomore
Junior
Senior
Graduate Student (Non MBA)
MBA Student

What is your (first) major? If freshman, choose "Freshman".

What is your second major? If not double majoring or undecided, do not answer this question.

Approximate Lines of Code written before enrolling in 6.100B

Prior Programming Experience?
None
HTML
AP Computer Science
Online coding course (code academy, etc.)
Programming Experience in language other than Python
Programming Experience in Python
Took 6.0001/6.100A before
Took a Python course at MIT during IAP before (e.g. 6.145)
Watched or Participated in Programming course in OCW or edX
College course using programming language other than Python
College course using Python

Why did you enroll in 6.100B?
To Learn how to Program
To Fulfill a Course Requirement
To Get a Good Grade
other

Select all of the resources that you are aware of or have used to help learn how to program.
Google
Online coding courses
Stack Overflow
Friends that know how to program

2) Class Info Assessment

(did you read the course info page?)

Which of the following count towards your grade?
problem sets
mandatory exercises
optional exercises on MITx
exams
lecture attendance and participation
recitation attendance and participation

When are problem sets due?
every Monday
every Wednesday
depends on the pset, check the calendar

When are mandatory finger exercises due?
generally available with the pset, and due with the pset
generally available with a lecture, and due by the beginning of next lecture
no deadline per exercise, but must do them all by the end of the course

Microquizzes are in the last 30-45 minutes of specific lectures outlined in the calendar. What happens if you cannot make it to a microquiz?
Email S^3 and post to the forum to schedule a conflict microquiz
Conflict microquizzes are not given but the lowest quiz grade is dropped

You are working with a friend on the problem set. Your friend tells you to use a specific kind of loop to solve a part. Is this a collaboration violation?
Yes for you and the friend
Yes only for the friend
Yes only for you
no

You are stuck debugging the problem set. Your friend already finished but they can't stay to help you anymore, so they email you the code. You look over the part you are stuck but write up your own code. Is this a collaboration violation?
Yes for you and the friend
Yes only for the friend
Yes only for you
no

3) Getting Started with Python

The rest of this problem set is about setting up your Python environment, writing a simple Python program, and submitting it on our website. Your submission will not be graded, but subsequent problem sets will rely on this procedure.

3.1) Collaboration

Please read carefully the Collaboration Policy in the course info page. For this pset, you may consult anyone to help set up your Python environment, but you should individually write and submit your Python program.

3.2) Setting up Python

Follow the Installing Python instructions under the About tab in the top menu. These will guide you through installing Python, the VS Code editor, and some Python packages we'll need in the course. If you choose not to use the VS Code setup outlined in those instructions, then you are responsible for providing your own Python environment. We use Python 3.9+ in this class, and require the following Python packages:

  • matplotlib
  • numpy
  • pandas
  • scikit-learn
  • seaborn

3.3) Your First Program

The goal is to exercise using some simple elements of Python, including: the ability to print out results (using the print operation), the ability to read input from a user at the console (using the input function), and the ability to store values in variables, so that the program can access those values as needed.

In the file named ps0.py, write a program that does the following in order:

  1. Ask the user to enter a number x.
  2. Ask the user to enter a number y.
  3. Print the value of x raised to the power y.
  4. Print all the digits of x followed by all the digits of y, with no spaces.

An example run of the program is shown below. The numbers printed after :   on a line are instances of a user's input. The rest should be printed by your program.

Enter number x: 78
Enter number y: 9
x to the power of y is 106868920913284608
x smushed with y is 789

When you finish installing your programming environment, you're all set. There is nothing to hand in for this problem set!