Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1total_marks = 0 | AThe names x, y and z are meaningless, so readers cannot tell what they represent. Use names like price, discount_rate and discount_amount. | |
| 2txtStudentName / txtStudentEmail | Bif student_age < minimum_age: | |
| 3Meaningful names make maintenance and debugging easier because a developer can quickly see what each element does | CThe names mix camelCase, snake_case and PascalCase, so they are inconsistent. Pick one pattern, such as student_name, student_age and student_year. | |
| 4A naming convention improves readability because a name describes the data it holds | DConsistent names that follow one shared pattern, so everyone on a team can understand each other's code | |
| 5x = 25 y = 0.1 z = x * y | EA meaningful name that tells the reader what the variable stores, which makes the code readable | |
| 6studentName = 'Ava' student_age = 16 StudentYear = 11 | Faverage_score = total_score / num_tests |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
naming convention — An agreed pattern for naming variables, functions and controls so code is readable, consistent across a team and easier to maintain and debug.studentName = "Ava"
print(studentName)price = 4.5
quantity = 3
totalPrice = price * quantitydef calcArea(width, height):
return width * height
area = calcArea(4, 5)scores = [80, 90]
for score in scores:
print(score)TAX = 0.1
price = 50
total = price + price * TAX