+, -, *, /, //, %, **
<, <=, >, >=, ==, !=
and, or, not
print
turtle
module: how to import, create turtle, use functions on turtle forward
, goto
, right
/left
, position
, dot
, up
, down
math
module: how to import, use functions sin
, radians
,random
module: how to import, use function random
for
loops, 3 ways to call range
, loop variable, accumulator patternif
, elif
, else
), nested if statementsI suggest you review chapters 1 & 2 from our book and all reading quizzes. Our book, homework, and all in-class activities give you many examples that you can work through to practice.
The exam will be conducted in-person during class over the period of two class sessions. It is closed book, no calculators, no notes. You will have the duration of class time to finish the exam. It must be completed individually.
Bring your laptop and a charger. You are responsible for ensuring your laptop is properly charged on the day of the exam. You may bring a single one-sided letter-sized sheet of handwritten notes. I suggest you write sparingly on the single note page that you may use, and continue to study vigorously for the exam. You will not have enough time to complete the exam if you rely too heavily on your single sheet of handwritten notes.
You will be a spare sheet of paper that has the academic integrity pledge. Print your name at the top. When you are finished with the exam, you will hand in this paper and show me on your laptop that your Moodle quiz has been submitted.
You will open Moodle in class. Moodle is the ONLY program that can be running; no other tabs in your browser, no plug-ins nor browser extensions, no Thonny, nor any other application. Moodle must be the ONLY tab open. Keep your eyes on your laptop only. Any violation of these expectations, such as if any other program or tab is opened except for Moodle, it is grounds for an immediate F on the exam.
Navigate on Moodle to “Exam 1 - Part A”. In class, I will give you the password to open the exam. There are roughly ~35 questions. Some problems are worth more points depending on their level of difficulty and number of subproblems. Questions have the following form.
((True or False) and False)
?You will be a spare sheet of paper that has the academic integrity pledge. Print your name at the top. When you are finished with the exam, you will hand in this paper and show me on your laptop that your python file has been submitted.
You will open Moodle and Thonny in class. These are the ONLY programs that can be running; no other tabs in your browser, no plug-ins nor browser extensions, no Thonny, nor any other application. Keep your eyes on your laptop only. Any violation of these expectations, such as if any other program is opened, it is grounds for an immediate F on the exam.
There are roughly ~3 programming problems to solve. It is expected that your code will not have any syntax errors, and will follow the implementation instructions. Questions may have the following form.
drawTriangle
that takes three parameters - two side lengths and the angle between them - and draws the triangle. Call/invoke the function to test it. Hint: you’ll need to remember the starting location. You can call goto(x,y)
on a turtle to move the turtle from one location to another.drawPolygon(n)
that takes one parameter n
. The function will create a turtle and use it to draw a polygon that has n
sides. Call/invoke your function to test it by drawing a square and a triangle.awkwardCount
that takes no parameters. The function should use a for loop to iterate through the first 20 integers (1 through 20 inclusive). For each number, it will either print out “uhm”, “err”, or the number. If the number is evenly divisible by 4, it will print “uhm”. If the number is evenly divisible by 5, it will print “err”. Otherwise, it will print out the number. Invoke the function to test it. Your function should use a for loop, selection statement, and the %
operator. The expected output is below:
1
2
3
uhm
err
6
7
uhm
9
err
11
uhm
13
14
err
uhm
17
18
19
uhm err
find
, index
, replace
, ord
, chr
, str
, count
) and immutabilityinput
functionappend
, insert
, pop
, sort
, reverse
, index
, count
, remove
) and mutabilitykeys
, values
, items
, get
, membership, index operator, del
) anditems
)I suggest you review chapters 3 & 4 from our book, and reading quizzes 8-14. Our book, homework, and all in-class activities give you many examples that you can work through to practice.
Instructions are the same as previous exam. The exam will be conducted in-person during class over the period of two class sessions. It is closed book, no calculators, no notes. You will have the duration of class time to finish the exam. It must be completed individually.
Bring your laptop and a charger. You are responsible for ensuring your laptop is properly charged on the day of the exam. You may bring a single one-sided letter-sized sheet of handwritten notes. I suggest you write sparingly on the single note page that you may use, and continue to study vigorously for the exam. You will not have enough time to complete the exam if you rely too heavily on your single sheet of handwritten notes.
You will be a spare sheet of paper that has the academic integrity pledge. Print your name at the top. When you are finished with the exam, you will hand in this paper with the time the exam was submitted and show me (or a TA/ZI) on your laptop that your Moodle quiz has been submitted.
You will open Moodle in class. Moodle is the ONLY program that can be running; no other tabs in your browser, no plug-ins nor browser extensions, no Thonny, nor any other application. Moodle must be the ONLY tab open. Keep your eyes on your laptop only. Any violation of these expectations, such as if any other program or tab is opened except for Moodle, it is grounds for an immediate F on the exam.
Navigate on Moodle to “Exam 2 - Part A”. In class, I will give you the password to open the exam. Some problems are worth more points depending on their level of difficulty and number of subproblems; you can see how many points a question is worth in Moodle on the left side. Review your answers before you submit. Questions have the following form.
5
.You will be a spare sheet of paper that has the academic integrity pledge. Print your name at the top. When you are finished with the exam, you will hand in this paper and show me on your laptop that your python file has been submitted.
You will open Moodle and Thonny in class. These are the ONLY programs that can be running; no other tabs in your browser, no plug-ins nor browser extensions, no Thonny, nor any other application. Keep your eyes on your laptop only. Any violation of these expectations, such as if any other program is opened, it is grounds for an immediate F on the exam.
There are roughly ~3 programming problems to solve. It is expected that your code will not have any syntax errors, and will follow the implementation instructions. Questions may have the following form.