Create the following directories for storing your answers to today's test. Make sure all of the files you create are stored within this directory.
$ cd ~/cs120/ $ mkdir test1 $ cd test1
You are only allowed to access this course webpage and the Python and Turtle documentation webpages. You are not allowed to access any other websites. You are not allowed to access files from your directory, or files from any other user's directories. Failure to abide by these rules is a violation of Academic Integrity, and will be treated as such.
Create a python program in a file called product.py. Your program should prompt the user for an integer \(n\), and print the product of all of the reciprocals from 1 to \(n\): \[ \prod_{x = 1}^{n} \frac{1}{x} = \frac{1}{1} \times \frac{1}{2} \times \ldots \times \frac{1}{n} \]
$ python3 product.py How many terms? 3 0.166666666666666666666
Write a python program that prompts the user to enter a number of squares, and uses Turtle graphics and a for loop to draw the specified number of concentric squares. There can be any distance between squares, but each square must be centered inside the square that surrounds it.
$ python3 concentric.py How many terms? 10
Write a python program which uses uses Turtle graphics
and for loops to draw a number of overlapping rings in a
pyramid shape as shown below. It can appear anywhere on the screen,
but must contain at least 10 rows, with one additional circle per
row. You can use the turtle.circle
function to draw a
circle on the turtle screen.