Final Exam Model Paper 3
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 = 101. Choose the correct option for each of the following questions.
Kiran helps at his family’s shop in Gorkha. He types this line to add two prices:
print("20" + "30")What does it print?
Pick an answer to see why.
For Tamu Lhosar, a school in Lamjung lines up its dancers. A student counts the places with this program:
dancers = 0for row in range(3): for place in range(4): dancers = dancers + 1print(dancers)What does it print?
Pick an answer to see why.
A wholesale shop in Pokhara keeps its 500 item names in a sorted list and finds them with binary search. It adds 500 more items, and the list stays sorted. Hari says, “Now each search will take twice as many comparisons.” Which judgment is right?
Pick an answer to see why.
Where in a web page does the <title> element go?
Pick an answer to see why.
Sunita takes a screenshot of her shop’s price list, with small printed text and plain colors, to send to customers. In which format should she save it so that the text stays sharp?
Pick an answer to see why.
A shop’s “Open” sign is a micro:bit running this program. How many times a second does the heart blink?
from microbit import *while True: display.show(Image.HEART) sleep(250) display.clear() sleep(250)Pick an answer to see why.
Every Friday, Kiran copies his family shop’s accounts to a pen drive, and has done so for a year. He has never opened any of the copies. Why is this a risk?
Pick an answer to see why.
A sweet shop’s sales doubled this year. Its poster shows last year as a small picture of a sweet box, and this year as the same picture twice as tall and twice as wide. Which judgment is right?
Pick an answer to see why.
What is a prompt?
Pick an answer to see why.
A next-word model was trained on three sentences: “Lhosar is fun.” “Lhosar is colorful.” “Dashain is fun.” Starting with “Dashain”, which sentence can it write, although it was never in its training text?
Pick an answer to see why.
Section B
8 × 1 = 82. Write very short answers to the following questions.
Which kind of error does Python give when a line is indented where it shouldn’t be?
Answer
An IndentationError. Python finds it before running anything.
Marking scheme
- IndentationError.
Which Python function shows the documentation of another function, such as round?
Answer
help(): help(round) shows what round does and what it needs.
Marking scheme
help().
Pemba straightens a tilted photo of the Lhosar dance. Afterwards, a thin strip is missing from every edge. Why?
Answer
Turned, the photo no longer fills its rectangle, and empty triangles appear at the corners. The editor zooms in just enough to hide them, which cuts a thin strip off every edge.
Marking scheme
- Turning leaves empty corners, so the editor zooms in to hide them and cuts off the edges.
Anil’s micro:bit thermometer, on the shop counter, reads 3 °C more than the thermometer on the wall. Give one reason.
Answer
temperature() measures the board’s processor chip, not the air. The chip warms itself while it works, so it reads a little warmer than the room.
Marking scheme
- It measures the chip inside the board, which is warmer than the air when it is working.
Write one line of HTML for a heading, one level below the page’s main heading, that says “Lhosar Dances”.
Answer
<h2>Lhosar Dances</h2>Marking scheme
<h2>Lhosar Dances</h2>(an h2, opened and closed).
A photo is 1,080 pixels wide and 1,350 pixels high. What is its aspect ratio?
Answer
1,080 : 1,350; dividing both by 270 gives 4 : 5, the tall shape for posts seen on an upright phone.
Marking scheme
- 4 : 5.
For Lhosar, Kiran’s shop gives a free calendar with every bill of Rs 1,000 or more. A customer’s bill comes to exactly Rs 1,000, but this program gives her no calendar. Which line is wrong, and what should it be?
bill = int(input("Bill in rupees: "))if bill > 1000: print("Free Lhosar calendar!")print("Thank you!")Answer
Line 2. 1000 > 1000 is False, so a bill of exactly Rs 1,000 misses out. “1,000 or more” is >=: if bill >= 1000:. (This is why the edge, 1,000 itself, is always worth testing.)
Marking scheme
- Line 2; it should be
if bill >= 1000:.
Ramila writes a letter in English to her ward chairperson, turns it into Nepali with a translation app, and wants to send it without reading it. Is that wise? Give a reason.
Answer
No. Translation tools make more mistakes in Nepali. English has one “you”, so the app must guess between तँ, तिमी, तपाईँ and हजुर, and a letter to the chairperson may come out rude. She should read it, and ask someone who knows both languages well to check it.
Marking scheme
- No, with a reason: the app may choose the wrong politeness (तिमी for तपाईँ) or other mistakes in Nepali, so it must be checked.
Section C
8 × 2 = 16Write short answers to the following questions.
A shopkeeper in Kaski weighs two bags of tea leaves, 1.1 kg and 2.2 kg, and adds them in Python:
tea = 1.1 + 2.2print(tea, "kg")It prints 3.3000000000000003 kg.
- i.Why doesn’t it print exactly 3.3?
- ii.Rewrite the first line so that it prints
3.3 kg.
Answer
- i.A computer stores a float in binary, and many decimals, such as 1.1, can’t be written exactly in binary (as ⅓ can’t be written exactly in decimals). The tiny error shows when the answer is printed.
- ii.Round it to 2 decimal places:
tea = round(1.1 + 2.2, 2)print(tea, "kg")Output
3.3 kgMarking scheme
- i. Floats are stored in binary, and 1.1 and 2.2 can’t be stored exactly, so a tiny error shows.
- ii.
tea = round(1.1 + 2.2, 2)(or round when printing).
A shop in Gorkha gives 10% off a shawl that costs Rs 250 for Lhosar:
price = 250discount = price * 10 / 100pay = price - discountprint(f"Pay Rs {pay}")- i.Write the output of the program.
- ii.The shopkeeper wants it to print
Pay Rs 225, with no.0. Rewrite one line to do it.
Answer
i. / always gives a float, so discount is 25.0, and pay is 250 − 25.0 = 225.0:
Output
Pay Rs 225.0ii. Turn the answer into a whole number, for example:
price = 250discount = price * 10 / 100pay = int(price - discount)print(f"Pay Rs {pay}")Output
Pay Rs 225(discount = price * 10 // 100 also works here: // gives a whole number when both sides are ints.)
Marking scheme
- i.
Pay Rs 225.0. - ii. A line that makes it whole:
pay = int(price - discount), or//for the discount, orint(pay)in the f-string.
Sabin writes a bill program for his uncle’s vegetable shop:
def bill(kg, rate): print(kg * rate) total = bill(2, 120) + bill(1, 80)print("Total:", total)- i.It prints 240 and 80, and then stops with an error. Why?
- ii.How should he change the function so that the program prints
Total: 320?
Answer
- i.The function prints each amount but doesn’t return it, so each call gives back
None. Line 4 then triesNone + None, and Python stops with a TypeError (unsupported operand type(s) for +: 'NoneType' and 'NoneType'). - ii.Change line 2 to
return kg * rate:
def bill(kg, rate): return kg * rate total = bill(2, 120) + bill(1, 80)print("Total:", total)Output
Total: 320Marking scheme
- i. The function prints but returns nothing (
None), andNone + Nonegives a TypeError. - ii.
return kg * ratein place of theprintline.
Write a function change(paid, cost) that returns the change a customer should get back, and use it to print the change for a customer who pays Rs 1,000 for a bill of Rs 865.
Answer
def change(paid, cost): return paid - cost print(change(1000, 865))Output
135Marking scheme
- A function
changewith the parameters paid and cost that returnspaid - cost. - A line that calls it with 1000 and 865 and prints the returned value (135).
For the school’s website, in 2026, Rojina finds two old pictures of Pokhara in a book: a photo taken in 1995, and a painting by an artist who died in 1990. Under Nepal’s Copyright Act, 2059:
- i.Is the photo still protected? Show your working.
- ii.Is the painting still protected? Show your working.
Answer
- i.No. A photo is protected for 25 years from when it was taken: 1995 + 25 = 2020, which has passed. (She should still credit the photographer, which is honest.)
- ii.Yes. Most work is protected for the maker’s whole life and 50 years after: 1990 + 50 = 2040. She needs permission to use it.
Marking scheme
- i. No: a photo is protected for 25 years, until 2020.
- ii. Yes: the maker’s life plus 50 years, until 2040.
Kiran puts a micro:bit by his shop’s door to count customers: when someone walks in, their shadow falls on it and the light level drops below 40. The program adds 1 whenever the light level is below 40, checking 10 times a second. One customer walks in slowly, and the count goes up by 20.
- i.Why did one customer give 20?
- ii.What must the program do instead?
Answer
- i.The customer’s shadow stayed on the board for about 2 seconds, and the loop checked 10 times a second. Every check found the light below 40, so each check counted again: about 20 times.
- ii.It must count only the moment the light changes from bright to dark. It remembers whether it was dark the last time round the loop (a variable like
was_dark), and counts only when it is dark now but wasn’t before.
Marking scheme
- i. The light stayed below 40 for many checks, and each check counted.
- ii. Count only when it changes from bright to dark, remembering what it was last time round.
Which part of Nepal’s Constitution makes privacy a right, and which act protects people’s personal data? Write one thing that act requires.
Answer
Article 28 of the Constitution makes privacy a right. The Privacy Act, 2075 (2018) protects personal data. It requires, for example, a person’s consent before their personal data is collected; or that data collected with consent is used only for the purpose it was collected for; or that a parent or guardian agrees before an under-18’s private matters are shared.
Marking scheme
- Article 28, and the Privacy Act, 2075 (2018).
- One thing it requires: consent before collecting, use only for the purpose given, or a guardian’s consent for an under-18.
For a two-minute speech at her school’s Lhosar program, Dolma tries two prompts.
- Prompt A: “Tell me about Lhosar.”
- Prompt B: “I am in Grade 8 and giving a two-minute speech at my school’s Tamu Lhosar program. Give me 5 main points about how Gurung families celebrate it, one short sentence each, and tell me which points I should check with my grandparents.”
Which prompt is better? Give two reasons.
Answer
Prompt B. It gives the context (Grade 8, a two-minute speech, Tamu Lhosar of the Gurung community), the format (5 points, one short sentence each) and a limit (which points to check), so the answer fits her job. Prompt A is vague, so it gets a long, general answer, perhaps about the wrong Lhosar (Nepal celebrates three: Tamu Lhosar of the Gurungs, Sonam Lhosar of the Tamangs and Gyalpo Lhosar of the Sherpas, among others). She still writes the speech herself and checks every point.
Marking scheme
- Prompt B, because it gives the context (who and what for).
- A second reason: it gives the format (5 short points) or a limit (what to check), so the answer is short and fits.
Section D
4 × 4 = 16Write long answers to the following questions.
At a Lhosar fair, a stall has a jar of beads. The stall keeper secretly types the number of beads first. Then a player guesses until right; after each wrong guess the program says “More” or “Fewer”. At the end it prints how many guesses the player took, and “You win a prize!” if it was 6 or fewer.
- i.Write the program. (3)
- ii.Why must both answers be converted with
int()? (1)
Answer
i.
beads = int(input("Stall keeper, the number of beads: "))guesses = 0guess = 0while guess != beads: guess = int(input("Your guess: ")) guesses = guesses + 1 if guess < beads: print("More") elif guess > beads: print("Fewer")print("Right! You took", guesses, "guesses.")if guesses <= 6: print("You win a prize!")With 37 beads, and the guesses 25, 40, 35, 37:
Output
Stall keeper, the number of beads: 37Your guess: 25MoreYour guess: 40FewerYour guess: 35MoreYour guess: 37Right! You took 4 guesses.You win a prize!ii. input() always gives a string. Comparing a string with a number with < is a TypeError; and if both stayed strings, < would compare them as text, letter by letter, so "9" < "37" would be False, and the hints would be wrong.
Marking scheme
- i. Asks for the number of beads, and a
whileloop that asks for guesses until one is right. - i. A counter of guesses that starts at 0 and goes up by 1 for each guess.
- i. “More” and “Fewer” by comparing each guess, and after the loop the number of guesses, with the prize only for 6 or fewer.
- ii.
input()gives strings, which can’t be compared as numbers (a TypeError, or text order instead of number order).
Five dancers for the Lhosar program must stand in order of height, shortest first. Their heights, in centimeters: 148, 135, 152, 140, 138. Sort them with insertion sort.
- i.Show the list after each item is placed. (2)
- ii.How many comparisons and how many swaps did it make? (1)
- iii.How many swaps would bubble sort make on the same list? Which of the two sorts usually makes fewer comparisons? (1)
Answer
i. The sorted part is in bold.
| Item placed | Comparisons | List after it |
|---|---|---|
| (start) | 148, 135, 152, 140, 138 | |
| 135 | 148 > 135: swap (135 is at the front) | 135, 148, 152, 140, 138 |
| 152 | 148 < 152: stop | 135, 148, 152, 140, 138 |
| 140 | 152 > 140: swap; 148 > 140: swap; 135 < 140: stop | 135, 140, 148, 152, 138 |
| 138 | 152 > 138: swap; 148 > 138: swap; 140 > 138: swap; 135 < 138: stop | 135, 138, 140, 148, 152 |
- ii.1 + 1 + 3 + 4 = 9 comparisons and 1 + 0 + 2 + 3 = 6 swaps.
- iii.6 swaps: on the same list, the two sorts make the same swaps. Insertion sort usually makes fewer comparisons, because it stops as soon as an item is in place, while bubble sort compares every pair in every pass.
Marking scheme
- i. The lists after placing 135 and 152 right.
- i. The lists after placing 140 and 138 right, ending 135, 138, 140, 148, 152.
- ii. 9 comparisons and 6 swaps.
- iii. 6 swaps for bubble sort too, and insertion sort usually makes fewer comparisons.
Read the web page and its style sheet, and answer the questions that follow.
index.html
<!DOCTYPE html><html lang="ne"> <head> <title>तमु ल्होसार</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>तमु ल्होसार</h1> <p class="note">तमु ल्होसार पुस १५ गते मनाइन्छ।</p> <p>गुरुङ समुदायको नयाँ वर्ष।</p> </body></html>style.css
.note { padding: 10px; border: 2px solid #8b1a1a; margin: 20px;}- i.On some computers the Nepali letters show as gibberish such as
त. Which line is missing, and where does it go? (1) - ii.The page looks the same with
lang="en". Why should it still saylang="ne"? (1) - iii.Say what each of
padding,borderandmargindoes to the paragraph. (1) - iv.Which paragraphs get the border, and why? (1)
Answer
- i.
<meta charset="utf-8">, in the<head>(usually its first line). It tells the browser to read the page’s bytes as UTF-8, the way Nepali text is stored. - ii.So that a screen reader reads it with a Nepali voice instead of English rules, and browsers and search engines know the page is in Nepali.
- iii.padding is the space inside the border, between it and the text (10 px); border is a 2 px dark red line round the paragraph; margin is the space outside the border, between it and the elements around it (20 px).
- iv.Only the first paragraph, the date:
.noteselects elements withclass="note", and the second paragraph has no class.
Marking scheme
- i.
<meta charset="utf-8">, in the head. - ii. For screen readers (a Nepali voice), and so browsers and search engines know the language.
- iii. Padding inside the border, the border a line round it, margin the space outside.
- iv. Only the first paragraph, because only it has
class="note".
Read the given passage and answer the questions that follow.
Asha, in Lamjung, uses the same password for her email, her school’s online classroom and a game. The game’s website is hacked, and its users’ passwords are posted online.
- i.Why is her email the most important account to protect? (1)
- ii.Why must she change the password of every account that used it, not only the game’s? (1)
- iii.What are recovery codes, and where should she keep them? (1)
- iv.Give one way a password manager would have helped her. (1)
Answer
- i.Her email is the master key: “Forgot password?” on her other accounts sends a reset link or code to it, so whoever controls her email can take over almost all her accounts.
- ii.Attackers try a leaked password on other websites too. With the same password, the game’s leak opens her email and classroom.
- iii.One-time codes an account gives when two-step login is switched on, each good for one login, for when her phone is lost. She should write them on paper and keep them safe at home, never only on her phone.
- iv.Any one: it makes a different, strong password for every account (so one leak opens only one account); it warns when a password is reused or found in a breach; it fills in a password only on the real website.
Marking scheme
- i. Other accounts’ password resets go to her email, so it opens the rest (the master key).
- ii. Attackers try a leaked password on other sites, and she used it everywhere.
- iii. One-time login codes for when the phone is lost, kept on paper at home.
- iv. One way: a different strong password for each account, warnings of reused or leaked passwords, or filling in only on the real site.
Practical exam
25 marksMarked 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.
Entry to the Lhosar fair. At the gate of a Lhosar fair, children under 5 go in free, children under 15 pay Rs 20, and everyone else Rs 50. Write a program that:
- asks for each visitor’s age, until the gatekeeper types
done; - prints what each visitor pays;
- at the end, prints the number of visitors and the money collected.
Run it in front of the teacher with the ages 4, 12 and 35, then done.
# Entry to the Lhosar fair: write your program herevisitors = 0Answer
visitors = 0money = 0answer = input("Age of the visitor (or done): ")while answer != "done": age = int(answer) visitors = visitors + 1 if age < 5: print("Free entry") elif age < 15: print("Pay Rs 20") money = money + 20 else: print("Pay Rs 50") money = money + 50 answer = input("Age of the visitor (or done): ")print("Visitors:", visitors)print("Money collected: Rs", money)Output
Age of the visitor (or done): 4Free entryAge of the visitor (or done): 12Pay Rs 20Age of the visitor (or done): 35Pay Rs 50Age of the visitor (or done): doneVisitors: 3Money collected: Rs 70The answer is kept as text until the program knows it isn’t done; only then is it turned into a number. Other wordings of the messages are fine.
Marking scheme
- Sets the visitors and the money to 0 before the loop.
- A
whileloop that repeats untildoneis typed. - Asks for each age with
input(), and converts it withint()only after checking it isn’tdone. - Counts each visitor.
- An
if/elif/elsewith the right boundaries (under 5, under 15, the rest). - Prints what each visitor pays, and adds it to the money.
- Prints the number of visitors and the money once, after the loop.
- Runs it in front of the teacher with 4, 12, 35,
doneand gets 3 visitors and Rs 70.
The fruit shop. A fruit shop in Kaski sells apples at Rs 180 a kilogram. This program should tell a customer what to pay. Run it, and type 2.5 for the kilograms.
rate = 180kg = int(input("How many kg of apples? "))print("Pay Rs", rate * kg)- 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, 1 and 0.5 kg: write what each should print first, then run it.
Answer
i. and ii. A ValueError, on line 2:
Error message
Traceback (most recent call last): File "main.py", line 2, in <module> kg = int(input("How many kg of apples? "))ValueError: invalid literal for int() with base 10: '2.5'int() can turn only a whole number’s text into a number. "2.5" has a decimal point, so int() can’t convert it.
iii. Use float(), which takes decimals:
rate = 180kg = float(input("How many kg of apples? "))print("Pay Rs", rate * kg)Output
How many kg of apples? 2.5Pay Rs 450.0iv.
| Kilograms | Should print | Kind of test |
|---|---|---|
| 2.5 | Pay Rs 450.0 | ordinary |
| 1 | Pay Rs 180.0 | ordinary |
| 0.5 | Pay Rs 90.0 | ordinary, less than 1 kg |
Marking scheme
- Names the ValueError and line 2.
- Explains that
int()can’t convert text with a decimal point. - Fixes it with
float(input(…)), and it runs. - Writes the expected results for 2.5, 1 and 0.5 first, and the program gives them.
A page about Tamu Lhosar. Make a small web page for your school’s Tamu Lhosar program with:
- a title, and a main heading;
- a sentence or two about Tamu Lhosar;
- a list of three things that happen at the program;
- the photo
lhosar.jpg, of Gurung women in Lhosar dress, 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.
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>Tamu Lhosar at Our School</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Tamu Lhosar at Our School</h1> <p>Tamu Lhosar, on Poush 15, is the new year of the Gurung community. Our school celebrates it with a program in the yard.</p> <h2>At the program</h2> <ul> <li>Ghatu and other Gurung dances</li> <li>Songs by Grade 8 students</li> <li>Snacks shared by families</li> </ul> <img src="lhosar.jpg" alt="A row of smiling Gurung women in bright Lhosar dress, with gold earrings and headbands, at Tamu Lhosar"> </body></html>style.css
body { font-family: sans-serif;} h1 { color: #8b1a1a;} 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 Tamu Lhosar. - A list (
<ul>or<ol>) with three<li>items, opened and closed correctly. - The photo shown with
<img src="lhosar.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.
Viva. The teacher asks each student about their own work, for example:
- i.In your fair program, why does it turn the answer into a number only after checking that it isn’t
done? What would happen if line 3 wereanswer = int(input(…))? (2) - ii.In the fruit shop, you got a ValueError. How is it different from a TypeError? (2)
- iii.The photo of the Gurung women is by Amarchobiabhi, shared under CC BY-SA 4.0. Before your page goes on the school’s website, what must the page say about the photo? And if you had taken a photo of these women yourself, what would you need first? (2)
Answer
- i.The gatekeeper types either an age or the word
done, so the answer must stay text until the program knows which it is. Withint(input(…)), typingdonewould stop the program with a ValueError, becauseint()can’t turn the word into a number, so the totals would never be printed. - ii.A ValueError is a value of the right type that can’t be used:
int()takes a string, but not the string"2.5". A TypeError is a value of the wrong type for the operation, such as addingNoneto a number, or joining a number to a string with+. - iii.A credit with what, who, where and which license, for example: “Photo: Gurung women at Tamu Lhosar, by Amarchobiabhi, CC BY-SA 4.0, via Wikimedia Commons.” The license allows the use only with that credit. For a photo of my own, I would need the women’s agreement before putting it online, because people who can be recognized should agree to be shown.
Marking scheme
- i. The answer may be the word
done, so it stays text until checked. - i. With
int()at once, typingdonegives a ValueError and the program stops before the totals. - ii. A ValueError: the right type, but a value that can’t be used (
"2.5"forint()). - ii. A TypeError: a value of the wrong type for the operation.
- iii. A credit: the photographer’s name and the license (CC BY-SA 4.0), and where it is from.
- iii. For their own photo, the agreement of the people in it, before it goes online.
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.
