Skip to content

← Final exam model papers

Final Exam Model Paper 9

Theory paper: 50 marksTime: 2 hours

Practical exam: 25 marksTime: 1 hour 30 minutes

All questions are compulsory.

A full practice run of the Grade 8 final exam: the theory paper (50 marks, 2 hours) and, below it, the practical exam (25 marks, 1 hour 30 minutes, at a computer, marked by the school). In the theory paper, work out on paper what each program does, as in the exam hall: its programs have no Run button. In the practical exam, the programs run on this page.

A practice paper by Science Playground, made to its own course’s grid; not an official exam paper.

Write your answers on paper first. Then open each answer and its marking scheme, and give yourself one mark for each point you got. In multiple choice, your first choice counts.

Section A

10 × 1 = 10

1. Choose the correct option for each of the following questions.

a.

A cooperative’s program records the ginger each farmer brings. What does it print?

kg = 48# kg = 55print("Ramesh brought", kg, "kg")  # weighed at the gate

Pick an answer to see why.

b.

A drip pipe waters a farmer’s tomatoes for a week: 5 liters on even-numbered days and 3 liters on the others. What does this program print?

water = 0for day in range(1, 8):    if day % 2 == 0:        water = water + 5    else:        water = water + 3print(water)

Pick an answer to see why.

c.

A farmers’ cooperative keeps its 300 members’ names in the order they joined. Ramesh says, “A linear search for one name always takes 300 looks.” Which judgment is right?

Pick an answer to see why.

d.

The cooperative’s page shows its address on three lines, inside one paragraph. Which element starts each new line?

Pick an answer to see why.

e.

Laxmi wants to put her photos of her village’s terraces on Wikimedia Commons, where many people will see and use them. She is happy for anyone to change them, but wants every changed version to stay just as open as hers. Which license should she choose?

Pick an answer to see why.

f.

A micro:bit is fixed flat on top of a post on a hillside farm, to warn if the ground starts to slide. One morning the post leans a little to the left. About what does accelerometer.get_x() give?

Pick an answer to see why.

g.

A weather app on Ramesh’s phone asks for his location, and offers his precise location or an approximate one. Which should he choose, and why?

Pick an answer to see why.

h.

Kamala sends a photo of her family’s new terrace farm, taken beside their house, to a big chat group as a file, not as a photo, “so that it stays sharp”. Which judgment is right?

Pick an answer to see why.

i.

Before a large language model reads text, it splits the words into small pieces, often a whole word, sometimes part of one. What are these pieces called?

Pick an answer to see why.

j.

A large language model, trained only to predict the next word, would just carry on any text it is given. Why does a chatbot built on it answer questions in a helpful, friendly way?

Pick an answer to see why.

Section B

8 × 1 = 8

2. Write very short answers to the following questions.

a.

What does the operator ** do in Python?

Answer

It raises a number to a power: 3 ** 2 is 3 × 3 = 9.

Marking scheme
  • Raises to a power (for example 3 ** 2 is 9).
b.

A program has the line price(30, 60), which makes the function price run with 30 and 60. What is such a line called?

Answer

A call (a function call): the function’s name with round brackets after it, holding the arguments. Only a call makes the function’s body run.

Marking scheme
  • A call (function call).
c.

Laxmi records the cooperative’s chairperson in a bare classroom with a hard floor, and her voice echoes in the recording. Why?

Answer

Hard walls and floors bounce the voice back, so the microphone hears it again a moment later: an echo. Soft things, such as curtains, cushions or clothes, soak the sound up instead, so a room full of them echoes much less.

Marking scheme
  • Hard surfaces reflect the sound back to the microphone (soft things would soak it up).
d.

Why does display.set_pixel(5, 2, 9) stop the program with a ValueError?

Answer

The display has 5 columns, numbered 0 to 4, so there is no column 5: x must be from 0 to 4 (and y too, and the brightness from 0 to 9).

Marking scheme
  • x (the column) goes only from 0 to 4, so 5 is out of range.
e.

Write the HTML for one row of a price table, with the cells “Junar” and “Rs 90”.

Answer
<tr><td>Junar</td><td>Rs 90</td></tr>
Marking scheme
  • A <tr> holding two <td> cells with the given words.
f.

Laxmi will put 20 photos of the terraces on the cooperative’s web page, and wants the page to load fast on a phone. In which format should she save them?

Answer

WebP: made for web pages, it gives smaller files than JPEG or PNG for the same photo, so the page loads faster.

Marking scheme
  • WebP.
g.

A farm diary program should keep asking until the farmer types a month number from 1 to 12. Gita typed 15, then 20, and the program saved month 20. Which line is wrong, and what should it be?

month = int(input("Month number (1 to 12): "))if month < 1 or month > 12:    month = int(input("Please type 1 to 12: "))print("Month", month, "saved")
Answer

Line 2: an if asks again only once. It should be while month < 1 or month > 12:, which keeps asking for as long as the number is out of range.

Marking scheme
  • Line 2; if should be while, so that it keeps asking.
h.

Laxmi needs the right Nepali spelling of a word for the cooperative’s new signboard. Should she ask a chatbot or look in a dictionary? Give one reason.

Answer

A dictionary. It gives the exact, checked spelling. A chatbot’s Nepali is weaker than its English, and it can give a wrong spelling just as confidently as a right one; a mistake painted on a signboard is costly to fix.

Marking scheme
  • A dictionary, with a reason: it is exact and checked, while a chatbot’s Nepali can be confidently wrong.

Section C

8 × 2 = 16

Write short answers to the following questions.

3.
[2]

Ramesh starts a program for his organic vegetable farm:

organic = trueprint("Organic farm:", organic)

Python stops with NameError: name 'true' is not defined. Did you mean: 'True'?

  • i.Why does Python treat true as the name of a variable?
  • ii.Rewrite line 1 correctly. What type of value will organic then hold?
Answer

i. The two true/false values are written True and False, with a capital letter and no quotes. true with a small t is not a value in Python, so Python takes it for a variable’s name, looks for a variable called true, and finds none.
ii.

organic = Trueprint("Organic farm:", organic)

Output

Organic farm: True

organic holds a bool (a Boolean).

Marking scheme
  • i. True must start with a capital letter; true is not a value, so Python looks for a variable of that name and finds none.
  • ii. organic = True, a bool.
4.
[2]

Hari sold 120 kg of tomatoes at Rs 85 a kg. His seeds, fertilizer and labor cost Rs 6,500.

sold = 120 * 85cost = 6500print("Profit: Rs", sold - cost)print(sold > cost)
  • i.Write the output of the program.
  • ii.What does the last line tell Hari, and what would it print if he had sold only 70 kg?
Answer

i. 120 × 85 = 10,200, and 10,200 − 6,500 = 3,700:

Output

Profit: Rs 3700True

ii. Whether he sold for more than his costs: True means he made a profit. For 70 kg, 70 × 85 = 5,950, which is less than 6,500, so it would print Profit: Rs -550 and False.

Marking scheme
  • i. Profit: Rs 3700, then True.
  • ii. It says whether he earned more than his costs; for 70 kg it prints False (a loss of Rs 550).
5.
[2]

A vegetable trader’s function gives Rs 5 a kg off for 20 kg or more:

def sale(kg, rate):    if kg >= 20:        rate = rate - 5    return kg * rate print(sale(30, 60))print(sale(60, 30))
  • i.Write the output.
  • ii.Shyam meant both calls to be for 30 kg at Rs 60 a kg. Why is the second answer different?
Answer

i. sale(30, 60): 30 ≥ 20, so the rate is 55, and 30 × 55 = 1,650. sale(60, 30): kg is 60 and rate 30, so the rate becomes 25, and 60 × 25 = 1,500.

Output

16501500

ii. Arguments are matched to the parameters in order: the first goes into kg, the second into rate. In the second call he swapped them, so the function worked out 60 kg at Rs 30, with the discount taken from the wrong number.

Marking scheme
  • i. 1650, then 1500.
  • ii. Arguments go to the parameters in order, and the second call has them swapped.
6.
[2]

Junar from Ramechhap are sorted by weight: 200 g or more is “large”, 150 g or more is “medium”, and the rest “small”. Write a function size(grams) that returns the size, and use it to print the sizes of a 210 g and a 140 g junar.

Answer
def size(grams):    if grams >= 200:        return "large"    elif grams >= 150:        return "medium"    else:        return "small" print(size(210))print(size(140))

Output

largesmall
Marking scheme
  • A function size with the parameter grams that returns the right word, checking 200 before 150.
  • Two calls that print the sizes for 210 and 140 (large, small).
7.
[2]

Laxmi edits a hazy photo of her village’s terraces.

  • i.She increases the contrast. What happens to pixels whose numbers are 60, 60, 60 (dark gray), 128, 128, 128 and 200, 200, 200 (light gray)?
  • ii.She then turns the saturation all the way down. What happens to a green pixel, 90, 160, 70?
Answer
  • i.Contrast pushes numbers away from the middle, 128: the dark gray 60s get darker (towards 0), the light gray 200s get lighter (towards 255), and 128, the middle itself, stays as it is. The photo looks crisper.
  • ii.With no saturation, a pixel’s three numbers become equal: the green turns into a gray. The whole photo becomes black and white.
Marking scheme
  • i. 60 gets darker, 200 lighter, and 128 stays the same.
  • ii. Its three numbers become equal: it turns gray.
8.
[2]

A farmer keeps his grain in a dark store room. A micro:bit inside it runs this:

from microbit import *import music while True:    if display.read_light_level() > 100:        music.pitch(880, 300)    sleep(1000)
  • i.What is the device for, and what are its input and output?
  • ii.With the door shut, the store’s light level is 0. Outside, it is about 200 by day and about 20 at night. Why would the device miss someone who opens the door at night, and how should the program be changed?
Answer
  • i.It warns that the store’s door has been opened (light gets in). Input: the light level, sensed by the LEDs. Output: the speaker, which beeps.
  • ii.At night the open door lets in a light level of only about 20, which isn’t above 100, so the condition stays False and it never beeps. The threshold must be lower, just above the shut store’s 0: for example if display.read_light_level() > 10:, then tested with the door opened by day and at night.
Marking scheme
  • i. It warns when the door opens; input the light level, output the speaker.
  • ii. At night the light (about 20) never goes above 100; lower the threshold to just above 0 (such as 10).
9.
[2]

What is a phone’s advertising ID? What can you do about it?

Answer

A long code that apps can read, so that ad companies know that the person who watched a video in one app is the same person reading news in another: it links what you do across apps. You can delete it in the phone’s settings (or ask apps not to track you), and then apps can’t link you through it.

Marking scheme
  • A code apps read to link what you do in different apps (for ads).
  • You can delete it (or ask apps not to track you) in the settings.
10.
[2]

Sunita’s AI app looks at a photo of her tomato leaves and says: “Late blight. Spray this pesticide at once.” Her neighbor says to buy it and spray today. Judge the neighbor’s advice, and say what Sunita should do.

Answer

The advice is risky. The app may be wrong, especially if it learned mostly from photos taken in other countries, and a wrong spray wastes money and can harm the soil, the crop and the people who eat it, while the real problem goes on. The app’s answer is a useful first guess: Sunita should show the leaves to an agricultural technician (or an experienced farmer) and spray only what they confirm.

Marking scheme
  • The neighbor’s advice is risky: the app can be wrong, and a wrong spray costs money and harms.
  • Use it as a first guess and check with an agricultural technician before spraying.

Section D

4 × 4 = 16

Write long answers to the following questions.

11.
[4]

A dairy cooperative in Syangja pays Rs 70 a liter for milk, but Rs 75 a liter to a farmer who brings 20 liters or more. It wants a program for its 5 farmers that asks how many liters each brought, prints what each is paid, and at the end prints the total paid and how many farmers got the higher rate.

  • i.Write the program. (3)
  • ii.Next month, a different number of farmers will come each day. What would you change so that the program works for any number of farmers? (1)
Answer

i.

total_paid = 0higher = 0for farmer in range(1, 6):    liters = int(input(f"Liters from farmer {farmer}: "))    if liters >= 20:        pay = liters * 75        higher = higher + 1    else:        pay = liters * 70    print("Pay: Rs", pay)    total_paid = total_paid + payprint("Total paid: Rs", total_paid)print("Farmers at the higher rate:", higher)

For 12, 25, 20, 8 and 30 liters:

Output

Liters from farmer 1: 12Pay: Rs 840Liters from farmer 2: 25Pay: Rs 1875Liters from farmer 3: 20Pay: Rs 1500Liters from farmer 4: 8Pay: Rs 560Liters from farmer 5: 30Pay: Rs 2250Total paid: Rs 7025Farmers at the higher rate: 3

ii. The loop runs exactly 5 times. Ask first how many farmers came, farmers = int(input("How many farmers today? ")), and loop for farmer in range(1, farmers + 1):; or use a while loop that keeps asking until 0 liters is typed for “no more farmers”.

Marking scheme
  • i. A loop that runs 5 times, asking for each farmer’s liters with input(), converted to a number.
  • i. An if … else that pays 75 a liter for 20 or more and 70 otherwise, printing each farmer’s pay.
  • i. A running total of the pay and a counter of farmers at the higher rate, both starting at 0 before the loop and printed after it.
  • ii. Ask for the number of farmers and use it in range() (or a while loop that stops at 0).
12.
[4]

A farmer fills 50 kg sacks with the rice she harvests. Read the pseudocode:

SET total TO 0SET full_sacks TO 0FOR day FROM 1 TO 4    INPUT kg    SET total TO total + kg    IF total >= 50 THEN        SET full_sacks TO full_sacks + 1        SET total TO total - 50    END IFEND FOROUTPUT full_sacks, total
  • i.She harvests 30, 35, 20 and 40 kg on the four days. Make a trace table of day, kg, total and full_sacks. (2)
  • ii.Write the output, and say what each number means. (1)
  • iii.Write the FOR line and the IF line in Python. (1)
Answer

i.

day kg total full_sacks
(start) 0 0
1 30 30 0
2 35 65, then 15 1
3 20 35 1
4 40 75, then 25 2

ii. 2 25: she filled 2 full sacks, and 25 kg are left over, in a sack not yet full.
iii.

for day in range(1, 5):    if total >= 50:

FOR day FROM 1 TO 4 includes 4, but range() stops one before its end, so it is range(1, 5).

Marking scheme
  • i. Days 1 and 2 correct (30, 0; then 65 → 15 with 1 sack).
  • i. Days 3 and 4 correct (35, 1; then 75 → 25 with 2 sacks).
  • ii. 2 and 25: two full sacks and 25 kg left over.
  • iii. for day in range(1, 5): and if total >= 50:.
13.
[4]

Read the web page and its style sheet, and answer the questions that follow.

index.html

<!DOCTYPE html><html lang="en">  <head>    <meta charset="utf-8">    <meta name="viewport" content="width=device-width, initial-scale=1">    <title>Ramechhap Farmers’ Cooperative</title>    <link rel="stylesheet" href="style.css">  </head>  <body>    <h1>Ramechhap Farmers’ Cooperative</h1>    <h3>Prices this week</h3>    <table>      <tr>        <th>Crop</th>        <th>Price a kg</th>      </tr>      <tr>        <td>Junar</td>        <td>Rs 90</td>      </tr>      <tr>        <td>Ginger</td>        <td class="sold-out">Rs 120</td>      </tr>    </table>    <p>Prices in red are sold out.</p>  </body></html>

style.css

.sold-out {  color: red;}
  • i.How many rows and columns does the browser show in the table, and which cells are in bold? (1)
  • ii.Which element does the CSS rule style, and what does it do? (1)
  • iii.Write two things in this page that make it harder for some people to use, and how to fix each. (2)
Answer
  • i.3 rows and 2 columns. The header cells, “Crop” and “Price a kg” (<th>), are in bold.
  • ii..sold-out picks the element with class="sold-out": the cell “Rs 120”. The rule colors its text red.

iii.

  • Color is the only signal that ginger is sold out: people who can’t tell red from other colors, and a screen reader, miss it. Say it in words too, such as <td>Rs 120 (sold out)</td>.
  • The headings skip a level, from <h1> to <h3>, so the page’s outline seems to have a part missing. Make it <h2>.
Marking scheme
  • i. 3 rows and 2 columns, with the header cells (Crop, Price a kg) in bold.
  • ii. The ginger price cell (class sold-out): its text is made red.
  • iii. Color as the only signal, fixed by saying “sold out” in words.
  • iii. The jump from h1 to h3, fixed by using h2.
14.
[4]

Read the given passage and answer the questions that follow.

Kamala keeps the files of her village’s farmers’ cooperative. Its member list is in a folder on the cooperative’s laptop, but there are copies of it in Downloads, on the desktop and on a pen drive. Last year’s annual report took her a week to lay out; now she must write this year’s. The board also wants the year’s results as a poster for the market wall. The report is an online document.

  • i.Where should the real member list live, and what are the other copies? (1)
  • ii.How can she start this year’s report from last year’s, without spoiling last year’s? (1)
  • iii.Turning the report into a poster for a new audience is called repurposing. How should she do it, so that the report stays as it is? (1)
  • iv.What does the online document’s version history keep, and what can she do with it? (1)
Answer
  • i.In one home: one folder (such as Cooperative › Members) where the real, newest copy lives. The others are only copies, and should be deleted or kept as copies.
  • ii.Reuse it: copy last year’s file and rename the copy for this year, so she keeps its headings and tables, and last year’s file stays untouched.
  • iii.Make a copy with a new name, such as results-poster-v01, and change the copy; the report stays as it is.
  • iv.Every saved change, with the time and who made it, and she can go back to any earlier version. (It lives only in that program and account, so her own version numbers are still useful.)
Marking scheme
  • i. One home: one folder for the real copy; the others are only copies.
  • ii. Copy last year’s file and rename the copy (reuse), leaving last year’s untouched.
  • iii. A copy with a new name, changed for the poster.
  • iv. Every saved change, with time and who, and a way to go back to any of them.

Practical exam

25 marks

Marked by the school. Work alone at a computer, with no internet and no AI, in front of the teacher, for 1 hour 30 minutes. Write and run each program, show it working, and answer the teacher’s questions. On this page, press Edit on a program to type in it, and Run to run it.

P1.
[8]

Good seed. Before buying seed for the whole village, a farmer tests 4 bags: from each bag he plants 20 seeds and counts how many sprout. Write a program that:

  • asks how many of the 20 seeds sprouted, for each of the 4 bags;
  • prints the percentage that sprouted, and “Good seed” if it is 80% or more;
  • at the end, prints which bag had the most seeds sprouting.

Run it in front of the teacher with 18, 13, 20 and 16 seeds.

# Good seed: write your program hereseeds = 20
Answer
seeds = 20best = 0best_bag = 0for bag in range(1, 5):    sprouted = int(input(f"Seeds that sprouted from bag {bag}: "))    percent = sprouted / seeds * 100    print("Sprouted:", percent, "%")    if percent >= 80:        print("Good seed")    if sprouted > best:        best = sprouted        best_bag = bagprint("Best: bag", best_bag)

Output

Seeds that sprouted from bag 1: 18Sprouted: 90.0 %Good seedSeeds that sprouted from bag 2: 13Sprouted: 65.0 %Seeds that sprouted from bag 3: 20Sprouted: 100.0 %Good seedSeeds that sprouted from bag 4: 16Sprouted: 80.0 %Good seedBest: bag 3

Other wordings of the messages are fine.

Marking scheme
  • A for loop that runs exactly 4 times.
  • Asks for each bag’s sprouted seeds with input(), converted with int().
  • Works out the percentage as sprouted ÷ 20 × 100, and prints it.
  • An if that prints “Good seed” for 80% or more (80 included).
  • Keeps the most seeds so far, starting before the loop.
  • Changes the best bag only when a bag does better.
  • Prints the best bag once, after the loop.
  • Runs it in front of the teacher with 18, 13, 20, 16 and gets the right output.
P2.
[4]

The ginger price. A trader in Ilam buys ginger from farmers at Rs 120 a kg. This program should work out what to pay a farmer. Run it, and type 2.5 for the kilograms.

kg = float(input("Kilograms of ginger: "))pay = kg * price_per_kgprice_per_kg = 120print("Pay: Rs", pay)
  • i.Write the kind of error and the line Python names.
  • ii.Say why it happens.
  • iii.Fix the program.
  • iv.Test it with 2.5, 10 and 0 kg: write what each should print first, then run it.
Answer

i. and ii. A NameError, on line 2:

Error message

Traceback (most recent call last):  File "main.py", line 2, in <module>    pay = kg * price_per_kg               ^^^^^^^^^^^^NameError: name 'price_per_kg' is not defined

Python runs the lines in order, from the top. Line 2 uses price_per_kg, but nothing is stored in it until line 3, which hasn’t run yet. The name is spelled rightly; it is used too early.

iii. Store the price before it is used, by swapping lines 2 and 3:

kg = float(input("Kilograms of ginger: "))price_per_kg = 120pay = kg * price_per_kgprint("Pay: Rs", pay)

Output

Kilograms of ginger: 2.5Pay: Rs 300.0

iv.

Kilograms Should print Kind of test
2.5 Pay: Rs 300.0 ordinary
10 Pay: Rs 1200.0 ordinary
0 Pay: Rs 0.0 edge
Marking scheme
  • Names the NameError and line 2.
  • Explains that the variable is used on line 2 before line 3 stores a value in it.
  • Fixes it by storing the price first, and it runs.
  • Writes the expected results for 2.5, 10 and 0 kg first, and the program gives them.
P3.
[7]

A page for a farmers’ cooperative. Make a small web page for a farmers’ cooperative in the hills, with:

  • a title, and a main heading;
  • a sentence or two about the cooperative’s farms;
  • a list of three crops it sells;
  • the photo terraces.jpg, of terraced fields on a hillside, with alt text;
  • at least one CSS rule in the style sheet that changes how the page looks.

Show it to the teacher, on a phone width as well.

Try it

A page for a cooperative

Your page, titled
  • Title

  • Language

  • Headings

  • Pictures

  • Contrast

  • Phone width

Change the code until every row has a ✓.

Your page is kept in this browser only. Nothing you type is sent anywhere.

terraces.jpg: Bijay Chaurasia, CC BY-SA 4.0, via Wikimedia Commons

Answer

One good page (yours will be different):

index.html

<!DOCTYPE html><html lang="en">  <head>    <meta charset="utf-8">    <meta name="viewport" content="width=device-width, initial-scale=1">    <title>Hill Farmers’ Cooperative</title>    <link rel="stylesheet" href="style.css">  </head>  <body>    <h1>Hill Farmers’ Cooperative</h1>    <p>Our 120 members farm terraces cut into the hills of Ramechhap, and sell together to get a fair price.</p>    <h2>What we sell</h2>    <ul>      <li>Junar</li>      <li>Ginger</li>      <li>Potatoes</li>    </ul>    <img src="terraces.jpg" alt="Green and brown terraced fields stepping down a hillside, with houses scattered among them">  </body></html>

style.css

body {  font-family: sans-serif;} h1 {  color: #2f5d1e;} img {  max-width: 100%;}

The max-width: 100% rule keeps the photo inside a phone’s screen.

Marking scheme
  • A <title> that says what the page is, with the skeleton (lang, head and body) kept correct.
  • One <h1> main heading at the top of the body.
  • A paragraph (<p>) about the cooperative.
  • A list (<ul> or <ol>) with three <li> items, opened and closed correctly.
  • The photo shown with <img src="terraces.jpg">.
  • Alt text that says what the photo shows (not just “photo” or “image”).
  • A CSS rule with a selector and a declaration (property: value;) that changes how the page looks.
P4.
[6]

Viva. The teacher asks each student about their own work, for example:

  • i.In your seed program, how does it remember which bag was best, and not only how many seeds sprouted? If bags 1 and 3 both had 20 seeds sprouting, which bag would it name, and why? (2)
  • ii.In the ginger price, price_per_kg was in the program, spelled rightly. Why did Python still say it was not defined? (2)
  • iii.In your page, each <li> is inside the <ul>. Why must </li> come before </ul>, and what is wrong with <p>Our <strong>organic</p></strong>? (2)
Answer
  • i.It keeps two variables: best, the most seeds so far, and best_bag, the number of the bag they came from. Whenever a bag beats best, both are changed together, so best_bag always names the bag of the best count. With a tie it names bag 1: sprouted > best is False for bag 3’s 20, which only equals the best, so nothing changes. (With >= it would name the last of the tied bags, bag 3.)
  • ii.Python runs a program one line at a time, from the top. A variable exists only once a line has stored a value in it. Line 2 used price_per_kg before line 3 had run, so at that moment Python had no variable of that name. The order of the lines matters as much as their spelling.
  • iii.Elements are nested: the one opened last closes first. An <li> is opened inside the <ul>, so it must close before the list closes. In <p>Our <strong>organic</p></strong> the elements cross: <strong> was opened inside the <p>, so </strong> must come before </p>: <p>Our <strong>organic</strong></p>.
Marking scheme
  • i. A second variable keeps the bag number, changed together with the best count.
  • i. Bag 1, because > changes nothing when a bag only equals the best.
  • ii. Python runs the lines in order, from the top.
  • ii. The price was used on line 2 before line 3 stored it, so the variable didn’t exist yet.
  • iii. The element opened last closes first (the <li> is inside the <ul>).
  • iii. The tags cross; </strong> must come before </p>.

Your score

0 / 50 theory

0 / 25 practical

34 questions not marked yet

Section A–Full marks 10
Section B–Full marks 8
Section C–Full marks 16
Section D–Full marks 16
Practical exam–Full marks 25

Marks lost, by unit

Mark a question to see your score here.

Score 0 of 0 0 of 34 marked Time left: 2:00:00