Part I due by 11:59 p.m. on Thursday, February 5, 2026.
Part II due by 11:59 p.m. on Sunday, February 8, 2026.
In your work on this assignment, make sure to abide by the collaboration policies of the course.
Using folders
We strongly encourage you to create a separate folder for each
assignment, so that you can more easily keep track of your
work. For example, you could create a folder called ps1 for your
work on this assignment, and put all of the files for PS 1 in
that folder.
If you have questions while working on this assignment, please
come to office hours, post them on Piazza, or email
cs111-staff@cs.bu.edu.
Make sure to submit your work on Gradescope, following the procedures found at the end of Part I and Part II.
If you haven’t already created a folder named cs111 for your
work in this course, follow these
instructions to do so.
Then create a subfolder called ps1 within your cs111 folder,
and put all of the files for this assignment in that folder.
20 points; individual-only
Important
In your work for this course, you must limit yourself to aspects of Python that we have discussed in lecture, unless the problem indicates otherwise. At a minimum, failure to do so will result in a score of 0 for the corresponding problem.
More generally, you are responsible for reading, understanding and following our policies on collaboration and academic misconduct. Please review them as needed and let us know if you have any questions.
Begin by creating the necessary file:
Make sure you are signed into your Google Drive account. Note that signing into BU Google Mail should accomplish the same thing. If needed, logout of any other Google accounts and then sign in to your BU Google Mail account.
Access the template that we have created by clicking on this link.
When asked, click on the Make a copy button, which will save a copy of the template file to your Google Drive.
Select File->Rename, and change the name of the file to
ps1pr1.
Add your work for Problem 1 to this file.
Once you have completed these problems, choose
File->Download->PDF document, and save the PDF file in your ps1
folder. The resulting PDF file (ps1pr1.pdf) is the one that you
will submit. See the submission guidelines at the end of Part I.
Here are your remaining tasks for this problem:
Assume that you have two variables x and y that have
each been assigned an integer value. Construct the boolean
expressions specified below, and put your answers in the
spaces provided in the ps1pr1 file that you created above.
Note: You should not include an if statement; you
simply need to provide the necessary boolean expression. Sample
boolean expressions include:
x < yx == y + 3Here are your tasks:
Write a boolean expression that tests if y is not equal
to one more than five times the value of x. Your
expression should not use one of the logical operators
(and, or, or not). Rather, it should use the operator
for testing whether one expression is not equal to another.
Write a boolean expression that tests if x is equal to either
3 or 4. Your expression should use
one of the logical operators (and, or, or not).
Write a boolean expression that tests if y is a multiple of 5.
%) can be used
to find the remainder of a division. For example,
10 % 2 is 0 because 2 divides evenly into 10.Write a boolean expression that tests if x is greater than or
equal to one-third of the value of y. Use integer division to
compute one-third of the value of y.
Write a boolean expression that tests if y is less than
x raised to the fourth power.
Consider the following Python program:
def mystery(vals): a = vals[0] b = vals[1] c = vals[2] if a >= b: if b < c: print('round') else: print('found') elif b >= c: print('mound') if b < a: print('pound') elif a < c: print('ground') elif b == c: print('wound') else: if a == 5: print('hound') print('zounds') print('redound')
In the table that we have provided in section 1-2 of ps1pr1,
add the output that would result from each of the following
function calls:
mystery([5, 7, 1])mystery([4, 4, 6])mystery([8, 6, 3])mystery([1, 2, 3])mystery([5, 7, 9])If needed, feel free to expand the space provided for each call’s output.
Note: You can check your answers by copying the program into a new editor file in Spyder and running it. However, make sure that you understand why you end up with the outputs that you do!
Once you have completed Problems 0 and 1, choose File->Download->PDF
document, and save the PDF file in your ps1 folder. The
resulting PDF file (ps1pr01.pdf) is the one that you will
submit. See the submission guidelines at the end of Part I.
15 points; individual-only
This problem will give you practice with indexing and slicing.
Getting started
If you haven’t already done so, create a folder named ps1
for your work on this assignment. You can find instructions for
doing so here.
Download this file: ps1pr2.py
Make sure to put the file in your ps1 folder. If your browser
doesn’t allow you to specify where the file should be saved, try
right-clicking on the link above and choosing Save as... or
Save link as..., which should produce a dialog box that allows you
to choose the correct folder for the file.
Open the file in Spyder, following the procedure outlined in Task 2 of Lab 1.
If you haven’t already done so, you should make sure to configure Spyder as we have instructed.
List puzzles
The first half of the problem focuses on lists. In particular, you
will be constructing new lists from the following:
pi = [3, 1, 4, 1, 5, 9] e = [2, 7, 1]
We’ve given you these lines in ps1pr2.py. In addition, we’ve provided
the answer to the first puzzle (puzzle 0). You should add in the
answers for the remaining puzzles, following the format that we’ve
given you for puzzle 0.
The expressions that you construct must only use
pi and e and the following list operations:
pi[0])e[1:] or pi[2:4])pi[6:4:-1])pi[:1] + e[1:]. Note that you may
not use + to add values numerically.)[e[2]] or [e[2], e[0]])You may also use parentheses if needed.
We encourage you to try using as few operations as possible, to keep your answers elegant and efficient. However, you will get full credit for any expression that follows the rules above and produces the correct result.
Before getting started, you should run ps1pr2.py in Spyder using the
“play” icon or F5. This will make the lists pi and e available
to you in the IPython console.
Here are the puzzles:
Use pi and/or e to create the list [2, 5, 9], and assign it to
the variable answer0. We’ve given you the code for this puzzle.
Use pi and/or e to create the list [7, 1] and assign it to
the variable answer1. Your answer should follow the format that
we’ve given you for problem 0. In other words, it should look like
this:
# Puzzle 1: # Creating the list [7, 1] from pi and e answer1 =
where you put the appropriate expression to the right of the
assignment operator (=). Please leave a blank line between
puzzles to make things more readable.
Use pi and/or e to create the list [9, 1, 1], and assign it to
the variable answer2. Here again, make sure to follow the
correct format, and to leave a blank line between puzzles.
Use pi and/or e to create the list [1, 2, 3, 4, 5], and
assign it to the variable answer3. (Optional challenge: See if
you can do this with just three list operations!)
String puzzles
The second half of the problem focuses on strings. In particular, you
will be working with the following strings:
b = 'boston' u = 'university' t = 'terriers'
We’ve given you these lines in ps1pr2.py, along with the answer
to the first string puzzle (puzzle 4).
The expressions that you construct for the remaining puzzles must
only use b, u, t and the following string operations:
b[0])u[1:] or t[2:4])u[6:4:-1])b + u)5*b or 3*u[-1])You may also use parentheses if needed.
Here again, you will get full credit for any expression that follows the rules above and produces the correct result, but we encourage you to try using as few operations as possible.
Before getting started, you should run ps1pr2.py in Spyder using
the “play” icon or F5. This will make the strings b, u, and t
available to you in the IPython console.
Here are the puzzles:
Use b, u, and/or t to create the string 'bossy', and assign it
to the variable answer4. We’ve given you the following code for
this puzzle:
# Example puzzle (puzzle 4) # Creating the string 'bossy' answer4 = b[:3] + t[-1] + u[-1]
Note that our answer involves 5 operations: 2 uses of indexing, 1 slice,
and 2 concatenations with +. (It’s actually possible to solve this
puzzle using only 3 operations. Give it a try if you have time!)
Use b, u, and/or t to create the string 'stone', and assign it
to the variable answer5. (Our best answer uses 3 ops.) Here again,
make sure to follow the correct format, and to leave a blank line
between puzzles.
Use b, u, and/or t to create the string 'nonononono', and
assign it to the variable answer6. (Our best: 2 ops.)
Use b, u, and/or t to create the string 'bestever', and
assign it to the variable answer7. (Our best: 7 ops.)
Use b, u, and/or t to create the string 'serenity', and
assign it to the variable answer8. (Our best: 4 ops.)
After finishing all of the puzzles, make sure to run your
ps1pr2.py file to check that the correct outputs are printed.
20 points; pair-optional
This is the only problem of the assignment that you may complete with a partner. See the rules for working with a partner on pair-optional problems for details about how this type of collaboration must be structured.
In this problem you will write a collection of simple functions that operate on numeric inputs.
Begin by downloading this file: ps1pr3.py
Make sure to put the file in your ps1 folder. If your browser
doesn’t allow you to specify where the file should be saved, try
right-clicking on the link above and choosing Save as... or
Save link as..., which should produce a dialog box that allows you
to choose the correct folder for the file.
Important guidelines:
You may find it helpful to review the example functions from lecture so you can use them as models for what you need to do.
Your functions must have the exact names that we have
specified, or we won’t be able to test them. Note in
particular that the case of the letters matters (all of them
should be lowercase), and that you should use an underscore
character (_) wherever we have specified one.
If a function takes more than one input, you must keep the inputs in the order that we have specified.
Each of your functions should include a docstring that describes what your function does and what its inputs are. See our example functions from lecture for models.
Make sure that your functions return the specified value,
rather than printing it. None of these functions should use a
print statement.
You should not use any Python features that we have not discussed in lecture.
Unless otherwise stated, your functions do not need to handle bad inputs – inputs with a type or value that doesn’t correspond to the description of the inputs provided in the problem.
Test each function after you write it. Here are two ways to do so:
Run your ps1pr3.py file after you finish a given function.
Doing so will display a message in the IPython console,
and you will then be able to use the console to call the
function using different inputs and check to see that you
obtain the correct outputs.
Optional: Add test calls to the test function that we
have provided at the bottom of your ps1pr3.py file. We
have given you an example of one such test call in the
starter file. After running your ps1pr3.py file, you
can call the test function (by entering test()) to see
the results of all of the test calls.
To facilitate grading, please put any test code inside a
function like the test function that we have given you.
Do not add any lines of code that
belong to the global scope of the program (i.e., lines that are
outside of any function).
Open your ps1pr3.py file in Spyder, and add to it your implementations
of following functions:
(example) Write a function opposite(x) that takes a
number x as its input and returns the opposite of its input.
We have given you this example function in the starter file.
Write a function pow(x, p) that takes two non-negative integers
x and p as inputs and returns the value of x raised to
the p power. For example:
>>> pow(5, 2) result: 25 >>> pow(10, 5) result: 100000
Important
Make sure that your function returns the correct
value rather than printing it. If your function is
printing the return value, you won’t see an output prompt
(the result: prompt above) before the return values. If
you don’t see that prompt, you must fix your
function so that it uses a return statement rather than
a print statement. This same warning applies to
all of the functions that you will write for this
assignment, with the exception of the optional test
functions that you may include for testing your code.
You should leave one or two blank lines between functions to make things more readable, and make sure to include a docstring like the one in our example function.
Make sure that you use the correct amount of
indentation. In particular, your docstrings should be
indented by 4 spaces as shown in our code for opposite,
so that they line up with the code inside the function.
Write a function larger(num1, num2) that takes two
numeric inputs num1 and num2 and returns the larger of the
two numbers. If the two numbers are equal, it can return either of them.
Your function must use conditional execution, and it
must not use any of Python’s built-in functions. In
particular, it must not use the max function.
Here are some examples of how it should work:
>>> larger(5, 2) result: 5 >>> larger(2, 5) result: 5 >>> larger(2, 2) result: 2
Write a function largest(num1, num2, num3) that takes three
numeric inputs num1, num2, and num3. It should return
the largest of the three numbers. If the three numbers are all
equal, it can return any one of them.
This function must NOT use conditional execution.
Rather, it should make two calls to the larger function that you
wrote above. Think about you could use two calls to larger to
determine the largest of the three inputs to this function.
In addition, your function must not use any of
Python’s built-in functions. In particular, it must not
use the max function.
Examples:
>>> largest(3, 2, 7) result: 7 >>> largest(7, 2, 3) result: 7 >>> largest(1, 1, 1) result: 1
Write a function median(a, b, c) that takes three numeric inputs
a, b, and c, and that returns the median of the three
inputs–i.e., the value that falls in the middle of the other two
when the three values are listed in increasing order. For example:
>>> median(10, 2, 7) # 7 is the middle value of 2, 7, 10 result: 7 >>> median(7, 2, 10) # 7 is still the middle value of 2, 7, 10 result: 7 >>> median(8, 6, 4) # 6 is the middle value of 4, 6, 8 result: 6
Your function must use conditional execution, and it must not use any of Python’s built-in functions. Your function should also work if two or more of the values are the same:
>>> median(10, 2, 2) # 2 is the middle value of 2, 2, 10 result: 2
Hint: Python makes it easy to test if one value is between two
other values. For example, to test if x is in the interval [0, 10],
we could use this expression:
0 <= x <= 10
In writing your function, you could do something similar to see if the value of one variable is between the values of the other two.
Don’t forget to test your functions using the approaches mentioned at the start of the problem.
You may also find it helpful to use the
Python Tutor Visualizer to trace through the execution of your functions –
either to verify that they’re working as expected, or to determine why
they’re not working! Paste your function definition into the
Visualizer’s code box, and follow the definition with code that calls
the function. Then click the Visualize Execution button below the
code box to begin the visualization. For example, to test the
circle_area function that we discussed in one of the
pre-lecture videos, you could paste the following into the Visualizer:
def circle_area(diam): radius = diam / 2 area = 3.14159 * (radius**2) return area test = circle_area(10) print('test is', test)
Login to Gradescope by clicking the link in the left-hand navigation bar, and click on the box for CS 111.
You will make submissions to two separate assignments on Gradescope. The steps needed for the two submissions are different, so please make sure to follow carefully the procedures outlined below.
PS 1: Problem 1
Submit your ps1pr1.pdf file using these steps:
If you still need to create a PDF file, open your file
on Google Drive, choose File->Download->PDF document, and
save the PDF file in your ps1 folder.
Click on the name of the assignment (PS 1: Problem 1) in the list of assignments on Gradescope. You should see a pop-up window labeled Submit Assignment. (If you don’t see it, click the Submit or Resubmit button at the bottom of the page.)
Choose the Submit PDF option, and then click the Select PDF button and find the PDF file that you created. Then click the Upload PDF button.
You should see a question outline along with thumbnails of the pages from your uploaded PDF. For each question in the outline:
As you do so, click on the magnifying glass icon for each page and doublecheck that the pages that you see contain the work that you want us to grade.
Once you have assigned pages to all of the problems in the question outline, click the Submit button in the lower-right corner of the window. You should see a box saying that your submission was successful.
PS 1: Problems 2 and 3
Submit your ps1pr2.py and ps1pr3.py files using these steps:
Click on the name of the assignment (PS 1: Problems 2 and 3) in the list of assignments. You should see a pop-up window with a box labeled DRAG & DROP. (If you don’t see it, click the Submit or Resubmit button at the bottom of the page.)
Add both files to the box labeled DRAG & DROP. You can either drag and drop the files from their folder into the box, or you can click on the box itself and browse for the files.
Click the Upload button.
You should see a box saying that your submission was successful.
Click the (x) button to close that box.
The Autograder will perform some tests on your files. Once it is done, check the results to ensure that the tests were passed. If one or more of the tests did not pass, the name of that test will be in red, and there should be a message describing the failure. Based on those messages, make any necessary changes. Feel free to ask a staff member for help.
Note: You will not see a complete Autograder score when you submit. That is because additional tests for at least some of the problems will be run later, after the final deadline for the submission has passed. For such problems, it is important to realize that passing all of the initial tests does not necessarily mean that you will ultimately get full credit on the problem. You should always run your own tests to convince yourself that the logic of your solutions is correct and that you have satisfied all of the stated requirements.
If needed, use the Resubmit button at the bottom of the page to resubmit your work. Important: Every time that you make a submission, you should submit all of the files for that Gradescope assignment, even if some of them have not changed since your last submission.
Near the top of the page, click on the box labeled Code. Then click on the name of each file to view its contents. Check to make sure that the files contain the code that you want us to grade.
Important
It is your responsibility to ensure that the correct version of every file is on Gradescope before the final deadline. We will not accept any file after the submission window for a given assignment has closed, so please check your submissions carefully using the steps outlined above.
If you are unable to access Gradescope and there is enough
time to do so, wait an hour or two and then try again. If you
are unable to submit and it is close to the deadline, email
your homework before the deadline to
cs111-staff@cs.bu.edu
10 points; individual-only
We will cover the material needed for this problem in Wednesday’s lecture.
Begin by creating the necessary file:
Make sure you are signed into your Google Drive account. Note that signing into BU Google Mail should accomplish the same thing. If needed, logout of any other Google accounts and then sign in to your BU Google Mail account.
Access the template that we have created by clicking on this link.
When asked, click on the Make a copy button, which will save a copy of the template file to your Google Drive.
Select File->Rename, and change the name of the file to
ps1pr4.
Here are your tasks:
Consider the following Python program:
def foo(a, b): b = b - 2 a = a - b print('foo', a, b) return a a = 5 b = 3 print(a, b) a = foo(a, b) print(a, b) foo(b, a) print(a, b)
In section 4-1 of ps1pr4, we have given you tables that can be
used to trace the execution of the program.
We have started the first and third tables for you. You should:
You may not need all of the rows provided in the tables.
Don’t forget that the global variables and local variables are two separate sets of variables, even though they happen to have the same names.
For an example of how to approach this problem, and of what your answer should look like, we encourage you to review the pre-lecture video called Tracing Function Calls that can be found on Blackboard in the lecture folder for 2/4.
Consider the following Python program:
def wow(a): b = a * 2 print('wow:', a, b) return b def yay(b): a = wow(b) + wow(b + 2) print('yay:', a, b) return a a = 4 b = 3 print(a, b) wow(b) print(a, b) a = yay(a) print(a, b)
In section 4-2 of ps1pr4, we have given you tables that can be
used to trace the execution of the program.
We have started the first and fourth tables for you. You should:
You may not need all of the rows provided in the tables.
Once you have completed Problem 4, choose File->Download->PDF
document, and save the PDF file in your ps1 folder. The
resulting PDF file (ps1pr4.pdf) is the one that you will
submit. See the submission guidelines at the end of Part II.
15 points; individual-only
In Spyder, open a new editor window using File -> New File,
and save it to your ps1 folder using the name ps1pr5.py.
Include comments at the top of the file that are similar to the ones
that we gave you at the top of ps1pr3.py.
Follow the same guidelines that we gave you for problem 3.
Write a function first_and_last(values) that takes a list values and
returns a new list containing the first value of the original
list followed by the last value of the original list.
You may assume that the original list has at least one value.
Although this function could be completed in one line, you must use the following template:
def first_and_last(values): """ put your docstring here """ first = ________ last = ________ return [first, last]
Here are some examples of how the function should work:
>>> first_and_last([1, 2, 3, 4]) result: [1, 4] >>> first_and_last([7]) # 7 is both first and last! result: [7, 7] >>> first_and_last(['how', 'are', 'you?']) result: ['how', 'you?']
Warning
Remember that your functions should return the correct
value rather than printing it. If your function is printing the
return value, you won’t see an output prompt (the result:
prompt above) before the return values. If you don’t see that
prompt, you must fix your function so that it uses a return
statement rather than a print statement. This same warning
applies to all of the functions that you will write for
this assignment, with the exception of the optional test
functions that you may include for testing your code.
Write a function move_to_end(s, n) that takes as inputs a
string value s and a non-negative integer n, and that returns the a new
string in which the first n characters of s have been moved to the
end of the string. For example:
>>> move_to_end('computer', 3) # move 'com' after 'puter' result: 'putercom' >>> move_to_end('computer', 5) # move 'compu' after 'ter' result: 'tercompu' >>> move_to_end('computer', 0) result: 'computer'
Special case: If n (the second input) is greater than or
equal to the length of s (the first input), then the function
should simply return the original s without changing it:
>>> move_to_end('hi', 5) # 5 > len('hi') result: 'hi'
Important: We strongly encourage you to use concrete cases to determine the logic of what the function needs to do. For example, consider the first test case above:
>>> move_to_end('computer', 3) result: 'putercom'
The function needs to take the first input ('computer') and
create two different slices/substrings that it can then
combine to form the correct return value.
s (which in this case is the string
'computer')?n (which in this case is 3)?By asking questions like these for this test case and other concrete cases, you should be able to come up with the general expressions that you can use to construct the necessary substrings, and then use those substrings to construct the correct return value.
Write a function reverse_n(s, n) that takes as inputs a string
s and a non-negative integer n. It should return a new
string in which the last n characters of s have been
reversed. For example:
>>> reverse_n('university', 4) result: 'univerytis' >>> reverse_n('programming', 3) result: 'programmgni'
Special case: If n is 0 or 1, the function should return
the original string s unchanged:
>>> reverse_n('programming', 1) result: 'programming'
Here again, you should use concrete cases to figure out the logic!
Hint: You can use skip-slicing to perform the necessary reversal
of the last n characters.
Don’t forget to test your functions using the approaches mentioned at the start of Problem 3. You may also find it helpful to use Python Tutor Visualizer to trace through the execution of your functions, as described at the end of Problem 3.
20 points; individual-only
In Spyder, open a new editor window using File -> New File,
and save it to your ps1 folder using the name ps1pr6.py.
Include comments at the top of the file that are similar to the ones
that we gave you at the top of ps1pr3.py.
Follow the same guidelines that we gave you for problem 3.
Write a function longer_len(s1, s2) that takes as inputs two
string values s1 and s2, and that returns the string with
the longer length. If the two strings have the same length,
the function should return the first string. For example:
>>> longer_len('computer', 'compute') result: 'computer' >>> longer_len('hi', 'hello') result: 'hello' >>> longer_len('begin', 'again') result: 'begin'
Write a function is_pal(s) that takes as input a string s
and returns True if s is a palindrome (i.e., a string
like 'radar' or 'mom' that reads the same backwards as it
does forward) and False otherwise. Examples:
>>> is_pal('radar') result: True >>> is_pal('abcda') result: False
Warning
Your function should return a boolean value – either True
or False, without any quotes around them. If you see
quotes around the result when you make the calls above from
the console, you must fix your function to return a boolean
and not a string.
Hint: Use skip-slicing!
Write a function replace_end(values, new_end_vals) that takes as
inputs a list values and another list new_end_vals, and that
returns a new list in which the elements in new_end_vals
have replaced the last n elements of the list values,
where n is the length of new_end_vals. For example:
>>> replace_end([1, 2, 3, 4, 5], [7, 8, 9]) result: [1, 2, 7, 8, 9]
In the above example, the second input has a length of 3, so we
replace the last 3 elements of the first input (the elements [3,
4, 5]) with the elements specified by the second input ([7, 8,
9]).
Other examples:
>>> replace_end([1, 2, 3, 4, 5], [10, 11]) result: [1, 2, 3, 10, 11] >>> replace_end([1, 2, 3, 4, 5], [12]) result: [1, 2, 3, 4, 12]
Special case: If the length of the second input is greater than or equal to the length of the first input, then the function should simply return the original second input:
>>> replace_end([0, 2, 4, 6], [4, 3, 2, 1]) result: [4, 3, 2, 1] >>> replace_end([0, 2, 4, 6], [4, 3, 2, 1, 0]) result: [4, 3, 2, 1, 0]
Here again, we encourage you to start with some concrete cases. For example, consider the first test case above:
>>> replace_end([1, 2, 3, 4, 5], [7, 8, 9]) result: [1, 2, 7, 8, 9]
In this test case, the function needs to take the lists [1, 2, 3,
4, 5] and [7, 8, 9] and create the list [1, 2, 7, 8, 9]. In
order to do so, it needs to extract a slice of the first list
and concatenate it to the second list.
values (which in this case is the list
[1, 2, 3, 4, 5])? new_end_vals (which in this case is [7, 8, 9])? By asking questions like these for this test case and other concrete cases, you should be able to come up with the general logic that you can use to determine the necessary return value. Also, don’t forget to handle the special case mentioned in the problem, which we recommend that you test for and handle first.
Hint: Begin by computing the length of new_end_vals and
storing it in an appropriately named variable. Then use that
variable in the rest of your code.
Write a function repeat_elem(values, index, num_times) that
takes as inputs a list values, an integer index (which you may
assume is a valid index for one of the elements in values), and
a positive integer num_times, and that returns a new list
in which the element of values at position index has been
repeated num_times times. For example:
>>> repeat_elem([10, 11, 12, 13], 2, 4) result: [10, 11, 12, 12, 12, 12, 13]
In the above example, the second input is 2 and the third input
is 4, so we take the element at position 2 of the list (the
12) and repeat it 4 times.
Other examples:
>>> repeat_elem([10, 11, 12, 13], 2, 6) # repeat element 2 six times result: [10, 11, 12, 12, 12, 12, 12, 12, 13] >>> repeat_elem([5, 6, 7], 1, 3) # repeat element 1 three times result: [5, 6, 6, 6, 7]
Here again, you should use concrete cases to figure out the logic!
Don’t forget to test your functions using the approaches mentioned at the start of Problem 3. You may also find it helpful to use the Python Tutor Visualizer to trace through the execution of your functions, as described at the end of Problem 3.
Login to Gradescope by clicking the link in the left-hand navigation bar, and click on the box for CS 111.
You will make submissions to two separate assignments on Gradescope. The steps needed for the two submissions are different, so please make sure to follow carefully the procedures outlined below.
PS 1: Problem 4
Submit your ps1pr4.pdf file using these steps:
If you still need to create a PDF file, open your file
on Google Drive, choose File->Download->PDF document, and
save the PDF file in your ps1 folder.
Click on the name of the assignment in the list of assignments on Gradescope. You should see a pop-up window labeled Submit Assignment. (If you don’t see it, click the Submit or Resubmit button at the bottom of the page.)
Choose the Submit PDF option, and then click the Select PDF button and find the PDF file that you created. Then click the Upload PDF button.
You should see a question outline along with thumbnails of the pages from your uploaded PDF. For each question in the outline:
As you do so, click on the magnifying glass icon for each page and doublecheck that the pages that you see contain the work that you want us to grade.
Once you have assigned pages to all of the questions in the question outline, click the Submit button in the lower-right corner of the window. You should see a box saying that your submission was successful.
If needed, use the Resubmit button at the bottom of the page to resubmit your work.
PS 1: Problems 5 and 6
Submit your ps1pr5.py and ps1pr6.py files using these steps:
Click on the name of the assignment in the list of assignments. You should see a pop-up window with a box labeled DRAG & DROP. (If you don’t see it, click the Submit or Resubmit button at the bottom of the page.)
Add both files to the box labeled DRAG & DROP. You can either drag and drop the files from their folder into the box, or you can click on the box itself and browse for the files.
Click the Upload button.
You should see a box saying that your submission was successful.
Click the (x) button to close that box.
The Autograder will perform some tests on your files. Once it is done, check the results to ensure that the tests were passed. If one or more of the tests did not pass, the name of that test will be in red, and there should be a message describing the failure. Based on those messages, make any necessary changes. Feel free to ask a staff member for help.
Note: You will not see a complete Autograder score when you submit. That is because additional tests for at least some of the problems will be run later, after the final deadline for the submission has passed. For such problems, it is important to realize that passing all of the initial tests does not necessarily mean that you will ultimately get full credit on the problem. You should always run your own tests to convince yourself that the logic of your solutions is correct.
If needed, use the Resubmit button at the bottom of the page to resubmit your work. Important: Every time that you make a submission, you should submit all of the files for that Gradescope assignment, even if some of them have not changed since your last submission.
Near the top of the page, click on the box labeled Code. Then click on the name of each file to view its contents. Check to make sure that the files contain the code that you want us to grade.
Important
It is your responsibility to ensure that the correct version of every file is on Gradescope before the final deadline. We will not accept any file after the submission window for a given assignment has closed, so please check your submissions carefully using the steps outlined above.
If you are unable to access Gradescope and there is enough
time to do so, wait an hour or two and then try again. If you
are unable to submit and it is close to the deadline, email
your homework before the deadline to
cs111-staff@cs.bu.edu
Last updated on February 9, 2026.