Assignments are designed to strengthen your problem-solving
skills and build independence.
While the module exercises are small variations of explained module examples,
a single assignment
will have multiple problems, all of which are intended to be
more challenging than the module exercises,
and will feature less detailed guidance. This is a good
thing because, ultimately, you'll have to solve problems
on your own. Facing and overcoming challenging
problems cheerfully is the key to building problem-solving
skill.
In each such assignment set, we will help develop your
problem-solving skills by showing you how to solve one
problem, the first and often hardest problem.
However, the solution will include some exercises
for you that you will need to submit.
Assignment problems
Demo problem.
Suppose we want to use for-loops to produce this arrow-head like pattern:
Notice the spaces between asterisks, the spaces leading up to
the first asterisk in each line, and the number at the end.
There's no space before the first asterisk on the first line.
In this exercise you will use a drawing tool and a for-loop
to draw a series of rectangles. The goal is to draw this:
This produces (we've added some markup to explain):
As a first step, download
drawtool.py
into your assignment1 folder and type up the above single-rectangle
example in
my_rectangle_example.py.
This way, you know that the download worked and that drawing works.
Now you can focus on the many-rectangle problem.
Think about how the for-loop needs to range so that you can
draw the rectangles in the loop.
Write your program in
my_rectangle_pattern.py.
The following program intends to print
hello
how're
you?
This is the alleged program:
print('hello")
print('how're')
print('you?)
There are several errors above. Point them out in your
assignment pdf. Then fix them in
fixed_hello.py.
The following program intends to print the following
five times as in:
xyz
xyz
xyz
xyz
xyz
This is the alleged program:
Def print_one_line():
for i in range(1,5):
print(xyz)
print_one_line
There are several errors above. Point them out in your
assignment pdf. Then fix them in
fixed_xyz.py.
The following program intends to print the
numbers 5 through 0 as in:
5
4
3
2
1
0
This is the alleged program:
def function#2()
for i in range(5,-1, 0):
print(i)
function#2()
There are several errors above. Point them out in your
assignment pdf. Then fix them in
fixed_downprint.py.
In each assignment, we will include a sometimes whimsical,
sometimes serious non-coding exploration to encourage creativity
and curiousity. For this assignment, in your
assignment1.pdf,
make a cartoon that makes light of "frustration with computers".
You can use a simple drawing tool, or find images that are
copyright-free (please include the link to images/cartoons).
Make sure the caption is original (this is the whole point).
We'll post some of the funniest ones.
A1.6 Audio:
How to submit:
Write all your programs and assignment1.pdf
in a directory called assignment1.