Quiz 1 Information
Quiz details
-
Quiz 1 will be held on Wednesday 7/10/24, during the 6-hour window of 15:00 - 21:00 EDT
- Boston (EDT): 3pm-9pm EDT
- China: Thursday 5/23/24 3am-9am
- UTC (UK time): 19:00-1:00 (+1 day)
-
You will have 30 minutes for the quiz including writing your answers and submission.
-
There are some sample/pratice questions at the bottom of this page. You will need to determine and write the answer(s) without a list of options to choose from.
-
In addition, there will be questions that ask you to write a function or a short program, similar to the examples from class or problem sets.
Quiz Logistics
-
The quiz will be conducted in the context of Gradescope. We will use the “online quiz” feature of Gradescope, in which you will type all of your answers directly into boxes within the web browser.
-
You may use blank scratch paper in preparing your answers to quiz questions, but you will type your final responses into Gradescope.
-
If you encounter technical errors with Gradescope during the quiz: write your answers on plain paper, scan the pages, and email them to Aaron (azs@bu.edu) as evidence of your work.
-
You may not use Spyder or any other Python tools to write, test, debug, or evaluate any code.
-
You may not use ChatGPT or any similar AI tools to write solutions for this quiz. We reserve the right to do a live oral exam with anyone suspected of using AI tools.
-
You should take the quiz by yourself in a quiet room, without assistance from others and without using resources of any kind. Although we cannot prevent you from consulting other resources, attempting to do so will likely cause you to run out of time. Moreover, the final exam will have a live proctor; if you cannot solve the problems on your own on the quizzes, you will not be successful for the final exam.
-
As this will be an independent quiz, the course staff is not available to help you with questions about the quiz during real-time. If you have questions or concerns during the quiz, write your questions or any assumptions clearly on you answer page, and we can discuss during office hours.
-
Aside from the machine on which you are reading the quiz, you must turn off and put away all other electronic devices including your phone.
-
You may not communicate with anyone during the quiz. You must not discuss the quiz with classmates until the entire quiz window is closed. Any discussion creates an unfair advantage to students who take the quiz a later time.
We reserve the right to conduct a separate one-on-one oral examination with any student to verify the student’s understanding of the material.
Material covered
The quiz will focus on the material that we have discussed in class during Week 1, modules 1 and 2.
You must be familiar with concepts that were introduced in the pre-class videos, in-class discussion, or on the problem sets that were not covered in the videos or readings.
Preparing for the quiz
-
One way to prepare is to review the videos and readings and class notes and make a summary of the key points in your own words. “Summarizing” the material in this way is a great way to ensure that you really understand the key concepts.
-
We also encourage you to do practice problems. Options include:
-
redoing the problems from the problem sets
-
additional practice problems (below)
-
-
When working on practice problems, try to come up with your answers on paper, rather than through a trial-and-error approach in Spyder or in another programming environment. This will be give you an experience that is similar to the one that you have during the quiz.
-
Feel free to post questions about the quiz on Piazza (using the
quiz1
tag).
Additional practice problems
-
Given the string
s = 'Marathon'
, evaluate the following expressions:s[0]
s[0:1]
s[1:]
s[-1]
s[3: :-1]
s[2: :2]
-
Given the list
myList = [3, 2, -1, [4, 7], 5]
, evaluate the following expressions:myList[0]
myList[0:1]
myList[-1]
myList[3]
myList[:2]
myList[2: :2]
-
What is printed by the following working Python program?
def dog(x): print('in dog, x is', x) y = cat(x - 1) + cat(x + 2) print('in dog, y is', y) return y def cat(y): print('in cat, y is', y) x = rat(y * 2) + 3 print('in cat, x is', x) return x def rat(x): print('in rat, x is', x) return 2 * x y = dog(3) print('at this level, y is', y)
-
What is printed by the following working Python program?
def mystery(x): print('x is', x) if x < 1: return 2 else: p = 6 - mystery(x - 1) print('p is', p) return p y = mystery(3) print('y is', y)
-
Write a function
to_celsius(degrees_f)
which returns the temperature in Celsius, given the temperature in degrees Fahrenheit. The temperature in Celsius is the amount in Farenheit - 32, times 5/9. For example, 50 degrees F is 10 degrees C.