COMP1010 - Midterm Revision
COMP1010 - Midterm Revision
NAME :
CLASS :
COMP1010 - Midterm Revision DATE :
44 Questions
1.
OMP1010
C
Midterm Revision
Week 8 - Interactive revision session for midterm exam
2.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 1/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
5.
Quiz 2 Review
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 2/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
6.
What is printed?
A 10 B 0
C SyntaxError D RuntimeError
7.
8.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 3/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
9.
10.
Try this condition if previous conditions failed
A if-else B elif
C else D if
11.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 4/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
12.
Error if "else" is not defined
A True B False
13.
14.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 5/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
15.
16.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 6/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
17.
Week 2
18.
Week 3
Reminder: Check your Lab 3 feedback! Know what you did right and wrong, and why!
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 7/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
19.
20.
Week 4
Strings Specification and Testing
Intro to sequences Precondition
Indexing, slicing Types of Errors
Mutability Testing and Debugging
String methods and operators Assert, try-except-else-finally
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 8/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
21.
Week 5
Conditionals Memory in Python
Boolean expressions Non-examinable (for now?)
If-else
If-elif-else
Nested if-else
22.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 9/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
23.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 10/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
25.
Week 6
Lists and Sequences
26.
Week 7
Iterations and Loops
27.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 11/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
28.
29.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 12/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
31.
32.
When will Dwight
become Manager?
Over the 9 seasons of The Office US,
Dwight Schrute had held multiple title at
the Dunder-Mifflin Scranton Branch.
However your best friend doesn't watch
The Office but wanted to catch up with
the show. Using your supreme
programming skill from COMP1010,
you've created a program to help your
friend figure out Dwight's current job title.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 13/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
33.
fter hearing a rumour that Prof. Kok-Seng is going to test you on
A
nested if-else, you decided to practice by changing your previous code:
34.
Python Circuit
Tester
You’re trying out electrical engineering
class in high school. In the first week
the teacher wanted you to write out a
Truth Table for the following circuit.
However, you’re already blessed by the
Python god and already knew how to
automate this boring task in Python.
Describe your approach.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 14/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
35.
Can you improve this?
36.
Can this be improved even further?
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 15/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
37.
38.
Water tank
simulation
You’re a mechanical engineer who was
tasked to figure out how long it would
take for a liquid nitrogen tank to be filled
if a new pump is installed. However,
today you don’t really feel like doing any
math, so you decided to run a
simulation instead. What kind of loop
can you use for this problem?
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 16/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
39.
40. our (very) distance cousin who is not-so-good-at-math, Anya, currently owns a restaurant chain
Y
with 2 branches.
She started a new promotion which discounted the prices for her favourite food: peanuts, cake,
and steak.
Anya now wants to know how big a difference in terms of money earned from the discounted
items compared to if it was sold at the original price. You are now tasked to perform this simple
analysis and she will pay you with 3 carrots.
(Assume you really hate Excel so decided to use Python instead).
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 17/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
41.
42.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 18/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
43.
44.
We're done!
(unless...?)
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 19/20
21/11/2022, 06:55 COMP1010 - Midterm Revision
Answer Key
1. 2. 3.n/a 4.
5. 6.a 7. 8.c
9. 10.b 11. 12.b
13. 14.c 15. 16.
17. 18. 19. 20.
21. 22.c 23. 24.
25. 26. 27.d 28.
29.c 30. 31. 32.
33. 34. 35. 36.
37. 38. 39. 40.
41. 42. 43. 44.
https://quizizz.com/print/quiz/6378aa0b94107c001de2cc5c 20/20