Final Exam Model Paper 2
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.
At the Dhankuta district sports meet, a runner qualifies for the final if she runs 100 m in under 13.5 seconds. Prakash records Rina’s time:
seconds = 13.2qualified = seconds < 13.5What type is the value in qualified?
Pick an answer to see why.
For a running drill on a school ground in Jhapa, the sports teacher puts a cone every 3 meters. A student writes the plan as a program:
for meters in range(3, 15, 3): print("Cone at", meters, "m")How many lines does it print?
Pick an answer to see why.
Sabina’s bubble sort sorts the list [5, 3, 8, 1] correctly. She can run one more test. Which list would tell her the most about how her sort deals with an edge case?
Pick an answer to see why.
Which HTML element makes a numbered list?
Pick an answer to see why.
Students filmed the Vivah Panchami procession in Janakpur, and their video will be shown on the wide TV in the school hall. Which shape should they crop and film it in?
Pick an answer to see why.
A school football team’s micro:bit scoreboard runs display.set_pixel(0, 4, 5). Which LED lights up?
Pick an answer to see why.
Ganesh names the photos of his school’s sports week so that, sorted by name, they come out in the order the events happened. Which name follows the best pattern?
Pick an answer to see why.
At an inter-district school sports meet, schools from Kathmandu won 40 medals and schools from Manang won 4. A poster says: “Kathmandu’s students are ten times better at sport than Manang’s.” Which judgment is right?
Pick an answer to see why.
What is generative AI?
Pick an answer to see why.
Why is a chatbot more often wrong about the history of a town in Nepal than about the history of a town in America?
Pick an answer to see why.
Section B
8 × 1 = 82. Write very short answers to the following questions.
Name the Python function that tells you the type of a value.
Answer
type(): for example, type(13.2) gives <class 'float'>.
Marking scheme
type().
Which Python keyword begins the definition of a function?
Answer
def, as in def points(position):.
Marking scheme
def.
Sujan pushed the brightness of his photo of a match far up, and the white clouds became flat white with no detail. Why can’t he get the detail back by lowering the brightness again?
Answer
The pixels’ numbers can’t go above 255, so the slightly different light parts of the clouds all became exactly 255, 255, 255: they were clipped. Lowering the brightness now darkens them all the same, because the differences between them are gone. He must go back to the original photo.
Marking scheme
- The bright pixels were all stopped at 255 (clipped), so the differences that made the detail are lost for good.
The football scoreboard’s micro:bit dims its LEDs when the light level is low. While Bina holds the board with her thumb across its top row of LEDs, display.read_light_level() gives 0, though the ground is in bright sun. Why?
Answer
The micro:bit has no separate light sensor: it measures light with the LEDs of its display (on a V2, the top row). Her thumb stops the light reaching them, so the board reads the dark under her thumb, not the sunny ground.
Marking scheme
- The board senses light with its LEDs (the top row), and her thumb covers them.
Write one CSS rule that makes the text of every paragraph on a page 18 pixels high.
Answer
p { font-size: 18px;}Marking scheme
- The selector
pwith the declarationfont-size: 18px;.
The school song, 4 minutes long, is saved as an MP3 at 128 kbit/s, which takes about 938 KB a minute. About how big is the file?
Answer
938 × 4 ≈ 3,750 KB, about 3.7 MB.
Marking scheme
- About 3,750 KB (3.7 MB); 3,752 KB is also right.
This program sorts runners into standards by their 100 m time. Asha runs 100 m in 12.1 seconds, but the program says “Bronze standard”. Why, and how should it be fixed?
time = float(input("Time for 100 m, in seconds: "))if time < 16: print("Bronze standard")elif time < 14: print("Silver standard")elif time < 12.5: print("Gold standard")Answer
In an if/elif chain, the first true condition wins. 12.1 < 16 is true, so Bronze is printed and the other checks are never made. Check the fastest standard first: time < 12.5 for Gold, then time < 14 for Silver, then time < 16 for Bronze.
Marking scheme
- The first true condition wins (12.1 < 16), so the checks must go from the fastest standard (Gold,
< 12.5) to the slowest.
At sports week, the school needs two jobs done by computer: i. giving 5, 3 and 1 points to the houses that come first, second and third; ii. telling from a photo whether a jumper’s foot crossed the long-jump board. Which job needs a model that learns from data? Give a reason.
Answer
Job ii. Nobody can write exact rules for what a foot over the board looks like in every photo and light, so a model trained on many photos labeled by judges is needed (and a judge should check its answer). Job i is a rule people decided, which an ordinary program follows exactly.
Marking scheme
- Job ii, because no one can write rules for how it looks in every photo (job i has exact rules).
Section C
8 × 2 = 16Write short answers to the following questions.
For a cross-country race at a school in Ilam, Kabita wrote:
laps = 6print("You ran " + laps + " laps")- i.Python stops with an error. Name the kind of error, and say why it happens.
- ii.Rewrite line 2 so that it prints
You ran 6 laps.
Answer
i. A TypeError. laps holds the int 6, and + can join a string only to another string: Python can’t join text and a number.
Error message
Traceback (most recent call last): File "main.py", line 2, in <module> print("You ran " + laps + " laps") ~~~~~~~~~~~^~~~~~TypeError: can only concatenate str (not "int") to strii. Turn the number into text with str(), or use an f-string:
laps = 6print("You ran " + str(laps) + " laps")print(f"You ran {laps} laps")Output
You ran 6 lapsYou ran 6 lapsMarking scheme
- i. A TypeError, because a string and an int can’t be joined with
+. - ii.
print("You ran " + str(laps) + " laps")orprint(f"You ran {laps} laps").
At the Dhankuta district sports meet, the announcer’s laptop shows each result. Write a program that asks for a runner’s name and her time in seconds (which may have a decimal), and prints a line like Asha Yadav: 100 m in 12.5 seconds.
Answer
name = input("Name of the runner: ")time = float(input("Time in seconds: "))print(f"{name}: 100 m in {time} seconds")Output
Name of the runner: Asha YadavTime in seconds: 12.5Asha Yadav: 100 m in 12.5 secondsThe time needs float(), not int(), because it may have a decimal: int("12.5") would stop with a ValueError. (The name stays a string.)
Marking scheme
- The name with
input(), and the time withfloat(input(…)). - A
printwith an f-string (orstr()and+, or commas) that gives the line in the right form.
A school in Janakpur prints seat slips for its drama night:
def ticket(name, seat="Back"): return name + ": " + seat + " row" print(ticket("Sunita", "Front"))print(ticket("Rajesh"))- i.Write the output.
- ii.Bishal adds the line
print(ticket()). What happens, and why?
Answer
i. Sunita’s call gives both arguments. Rajesh’s gives only the name, so seat takes its default value, "Back":
Output
Sunita: Front rowRajesh: Back rowii. Python stops with a TypeError: ticket() missing 1 required positional argument: 'name'. name has no default value, so every call must give it.
Marking scheme
- i.
Sunita: Front rowandRajesh: Back row. - ii. A TypeError, because name has no default and the call gives no argument for it.
At sports week, a house gets 5 points for first place, 3 for second, 1 for third, and 0 otherwise. Write a function points(position) that returns a house’s points for one event, and use it to print the total points of Red House, which came first in the relay and third in the tug of war.
Answer
def points(position): if position == 1: return 5 elif position == 2: return 3 elif position == 3: return 1 else: return 0 print(points(1) + points(3))Output
6Marking scheme
- A function
pointswith the parameter position that returns 5, 3, 1 or 0 by position. - A line that calls it for 1 and 3 and prints the sum of the returned values (6).
The school magazine, sold for Rs 50, wants to use Suyash.dwivedi’s photo of the Janaki Mandir from Wikimedia Commons, cropped to fit the cover. The photo is licensed CC BY-SA 4.0.
- i.May the school crop the photo and use it in a magazine that is sold? Give a reason.
- ii.Write the credit line the magazine should print.
Answer
- i.Yes. CC BY-SA allows changes and use for money, as long as the photographer is credited (BY) and the changed photo is shared under the same license (SA). There is no NC (not for money) and no ND (no changes).
- ii.For example: “Cover: Janaki Mandir, Janakpur, by Suyash.dwivedi, CC BY-SA 4.0, via Wikimedia Commons. Cropped by the magazine team.”
Marking scheme
- i. Yes, because CC BY-SA allows changes and selling, with credit, and the cropped photo shared under CC BY-SA.
- ii. A credit with what, who, where and which license.
For the sports-week walking challenge, Sapana ties a micro:bit to her shoe:
from microbit import *steps = 0while True: if accelerometer.was_gesture("shake"): steps = steps + 1 if button_a.was_pressed(): display.scroll(steps)- i.She walks once round the track, then presses A. What does the display show while she walks, and what does it show after she presses A?
- ii.Why might its count be different from the number of steps she really took?
Answer
- i.Nothing while she walks: each jolt of a step is counted by the accelerometer (a “shake”), but the program shows the count only when A is pressed. After she presses A, the display scrolls the number of steps counted so far.
- ii.A sensor’s reading is a measurement, not the truth: a jolt that isn’t a step (jumping, a bumpy bus ride, tapping the foot) is counted too, and a soft, slow step may not jolt the board enough to count.
Marking scheme
- i. Nothing while she walks (the steps are only counted); after A, the count scrolls across the display.
- ii. Any jolt counts as a step, and a gentle step may be missed, so the count is only close to the real number.
What is sensitive personal data? Write any two examples.
Answer
Sensitive personal data is the personal data that can do the most harm if it leaks or is misused, so it deserves the most care. Any two of: health, caste or ethnicity, religion, political views, fingerprints and face, a family’s money.
Marking scheme
- Personal data that can do the most harm if it leaks or is misused.
- Any two examples: health, caste or ethnicity, religion, political views, fingerprints or face, family’s money.
A video is shared in Bina’s family group: a famous Nepali cricketer says that a new app “doubles your money in a month”. Bina’s uncle wants to put Rs 20,000 in at once. Bina says they should check first. Judge what each of them wants to do, with a reason.
Answer
The uncle’s plan is risky. The video may be a deepfake: AI can make a real person’s face and voice say anything, and a famous face is often used to sell fake investments. A promise to double money quickly, and the hurry, are signs of a scam.
Bina is right. They should check who and where, not only what: is the offer on reliable news websites, or on the cricketer’s own official pages? Until then they shouldn’t pay, or share the video further.
Marking scheme
- The uncle: risky, because the video may be a deepfake and a quick, too-good promise is a sign of a scam.
- Bina: right, because they should check reliable sources (news, the cricketer’s official pages) before paying or sharing.
Section D
4 × 4 = 16Write long answers to the following questions.
At Tihar, Grade 8 students go from house to house playing Deusi to raise money for their school library. They want a program that asks for the gift at each house (in rupees) until they type 0 at the end of the evening, and then prints the number of houses, the total, and the biggest gift, and “Enough for the library books!” if the total is Rs 5,000 or more.
- i.Write the program. (3)
- ii.Which variable is the “highest so far”? Why may it start at 0 here? (1)
Answer
i.
total = 0houses = 0biggest = 0gift = int(input("Gift at this house (0 to stop): Rs "))while gift != 0: houses = houses + 1 total = total + gift if gift > biggest: biggest = gift gift = int(input("Gift at this house (0 to stop): Rs "))print("Houses visited:", houses)print("Total: Rs", total)print("Biggest gift: Rs", biggest)if total >= 5000: print("Enough for the library books!")For gifts of 1001, 500, 2100 and 1500:
Output
Gift at this house (0 to stop): Rs 1001Gift at this house (0 to stop): Rs 500Gift at this house (0 to stop): Rs 2100Gift at this house (0 to stop): Rs 1500Gift at this house (0 to stop): Rs 0Houses visited: 4Total: Rs 5101Biggest gift: Rs 2100Enough for the library books!A while loop fits, because nobody knows in advance how many houses they will visit.
ii. biggest is the highest so far: it is compared with each gift and replaced by a bigger one. It may start at 0 because every gift typed is more than 0, so the first gift always replaces it.
Marking scheme
- i. A
whileloop that asks for each gift withint(input(…))and stops when 0 is typed. - i. A counter of houses and a running total of the gifts, both starting at 0 before the loop.
- i. The biggest gift kept with
if gift > biggest, and the results printed after the loop, with the message only when the total is at least 5,000. - ii. biggest is the highest so far; it can start at 0 because every gift is more than 0.
In the high jump at a school in Kathmandu, four students cleared these heights, in centimeters: 125, 110, 130, 105. Sort them from smallest to biggest with bubble sort.
- i.Show the list after each comparison of the first pass. (2)
- ii.Show the list after each pass. After how many passes does bubble sort stop, and why? (1)
- iii.How many swaps did it make in all? (1)
Answer
i. Pass 1 compares each pair of neighbors, left to right:
| Comparison | Swap? | List after it |
|---|---|---|
| 125 and 110 | yes | 110, 125, 130, 105 |
| 125 and 130 | no | 110, 125, 130, 105 |
| 130 and 105 | yes | 110, 125, 105, 130 |
ii.
| Pass | Swaps | List after it |
|---|---|---|
| 1 | 2 | 110, 125, 105, 130 |
| 2 | 1 (125 and 105) | 110, 105, 125, 130 |
| 3 | 1 (110 and 105) | 105, 110, 125, 130 |
| 4 | 0 | 105, 110, 125, 130 |
It stops after 4 passes: the list was sorted after pass 3, but only a pass with no swaps shows that every pair is in order.
iii. 2 + 1 + 1 = 4 swaps.
Marking scheme
- i. The first two comparisons right: 125 and 110 swapped, then 125 and 130 left.
- i. The third right: 130 and 105 swapped, giving 110, 125, 105, 130.
- ii. Passes 2 and 3 right, and 4 passes, because bubble sort stops only after a pass with no swaps.
- iii. 4 swaps.
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"> <title>Sports Week Results</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>Sports Week Results</h1> <table> <tr> <th>Event</th> <th>Winner</th> </tr> <tr> <td>100 m race</td> <td class="winner">Asha Yadav</td> </tr> <tr> <td>Long jump</td> <td class="winner">Bibek Mahato</td> </tr> </table> </body></html>style.css
.winner { color: #006400;}- i.What is the difference between the
<th>cells and the<td>cells? (1) - ii.What does the CSS rule select, and what does it do? (1)
- iii.On a phone, the whole page looks tiny and has to be zoomed. Which line is missing, and where does it go? (1)
- iv.Sanjay wants to use a table to put a photo on the left of the page and the text on the right. Why is this a bad idea? (1)
Answer
- i.
<th>cells are headings of the columns (shown bold and centered, and read out by a screen reader with each cell);<td>cells hold the data. - ii.
.winnerselects every element withclass="winner": here the two winners’ names. It colors them dark green (#006400); the event names stay as they were. - iii.The viewport line, inside the
<head>:<meta name="viewport" content="width=device-width, initial-scale=1">. Without it, a phone lays the page out about 980 pixels wide and shrinks it to fit. - iv.A table is for data in rows and columns. A screen reader reads a table as data, cell by cell, so a page laid out in a table confuses blind visitors, and it doesn’t fit a phone’s narrow screen.
Marking scheme
- i.
<th>is a heading cell,<td>a data cell. - ii. It selects the elements with class
winner(the winners’ names) and colors them dark green. - iii. The viewport
<meta>line, in the head. - iv. Tables are for data only; a layout table confuses screen readers (or doesn’t fit phones).
Read the given passage and answer the questions that follow.
Last month, Sabita in Dhanusha wrote her speech for the sports week prize-giving on the family laptop, and her coach sent her the team photo in a chat app. Now, the night before the event, she can’t find either. All her files are in Downloads, with names like
speech final.docxandIMG_2231.jpg.
- i.She remembers only that the speech was a document she saved last month. How can a search help her find it? (1)
- ii.Where should she look for the photo her coach sent? (1)
- iii.Why is Downloads not a good home for her files? (1)
- iv.Write a good folder path for the speech, following the rules for a folder tree. (1)
Answer
- i.Narrow the search to the kind of file (documents) and the time (last month); on a computer, search also looks for words inside documents, such as a line from her speech.
- ii.In the chat app: a photo sent in a chat is saved in that app’s own folder, and the chat has a list of every photo and file shared in it.
- iii.Downloads is an inbox, not a home: files from the internet and chats land there and pile up mixed together. What she wants to keep should be moved to its own place, and the rest deleted.
- iv.By what it is, then the year, then the subject or event, three or four levels deep: for example School › Grade 8 (2083) › Sports week › speech-v01.docx.
Marking scheme
- i. Search by kind (documents) and time (last month), or for words inside it.
- ii. The chat app’s own folder, or the chat’s list of shared files.
- iii. Downloads is an inbox where everything piles up; files should be moved to their home.
- iv. A path by what it is, then year, then event (such as School › Grade 8 (2083) › Sports week).
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.
Free throws. To join the school basketball team, each student takes 5 free throws. Write a program that:
- asks after each throw whether it went in or out;
- if anything else is typed, asks again until the answer is
inorout; - at the end, prints the score out of 5, and “Selected for the school team!” if the score is 3 or more, otherwise “Keep practicing!”.
Run it in front of the teacher with the answers in, out, in, inn, in, out (the fourth answer is a typing mistake).
# Free throws: write your program herescore = 0Answer
score = 0for shot in range(1, 6): result = input(f"Throw {shot}: in or out? ") while result != "in" and result != "out": result = input("Please type in or out: ") if result == "in": score = score + 1print("Score:", score, "out of 5")if score >= 3: print("Selected for the school team!")else: print("Keep practicing!")Output
Throw 1: in or out? inThrow 2: in or out? outThrow 3: in or out? inThrow 4: in or out? innPlease type in or out: inThrow 5: in or out? outScore: 3 out of 5Selected for the school team!The for loop counts the 5 throws; the while inside it keeps asking until the answer is one of the two allowed. Other wordings of the messages are fine.
Marking scheme
- Sets the score to 0 before the loop.
- A
forloop that runs 5 times (for examplerange(1, 6)orrange(5)). - Asks for each throw with
input(). - A
whileloop that asks again while the answer is neitherinnorout. - Its condition is right (
!= "in" and != "out"). - Adds 1 to the score only for
in. - Prints the score once, after the loop, with the right message for 3 or more and for less.
- Runs it in front of the teacher with in, out, in, inn, in, out, and gets a score of 3 and “Selected”.
The entry fee. Each event at sports week costs Rs 20 to enter. This program should tell a student what to pay. Run it, and type 3 for the number of events.
fee = 20events = int(input("How many events will you enter? "))total = Fee * eventsprint("Pay Rs", total)- i.Write the kind of error and the line Python names.
- ii.Say why it happens.
- iii.Fix the program.
- iv.Test it with 1, 3 and 0 events: write what each should print first, then run it.
Answer
i. and ii. A NameError, on line 3:
Error message
Traceback (most recent call last): File "main.py", line 3, in <module> total = Fee * events ^^^NameError: name 'Fee' is not defined. Did you mean: 'fee'?Python names are case-sensitive: fee (line 1) and Fee are different names, and nothing was ever put in Fee.
iii. Use the same name as on line 1:
fee = 20events = int(input("How many events will you enter? "))total = fee * eventsprint("Pay Rs", total)Output
How many events will you enter? 3Pay Rs 60iv.
| Events | Should print | Kind of test |
|---|---|---|
| 1 | Pay Rs 20 | ordinary |
| 3 | Pay Rs 60 | ordinary |
| 0 | Pay Rs 0 | edge |
Marking scheme
- Names the NameError and line 3.
- Explains that
Feeandfeeare different names, andFeewas never given a value. - Fixes it with
fee, and it runs. - Writes the expected results for 1, 3 and 0 first, and the program gives them.
A page about the Janaki Mandir. Make a small web page for visitors to Janakpur with:
- a title, and a main heading;
- a sentence or two about the Janaki Mandir;
- a list of three things a visitor can see or do in Janakpur;
- the photo
janaki-mandir.jpg, of the temple, 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>The Janaki Mandir, Janakpur</title> <link rel="stylesheet" href="style.css"> </head> <body> <h1>The Janaki Mandir</h1> <p>The Janaki Mandir in Janakpur is a large white temple dedicated to Sita, with many domes and towers.</p> <h2>In Janakpur you can</h2> <ul> <li>Watch the evening aarati at the temple</li> <li>See the Vivah Panchami festival in winter</li> <li>Walk round the ponds of the old city</li> </ul> <img src="janaki-mandir.jpg" alt="The white Janaki Mandir with its many domed towers, under a blue sky"> </body></html>style.css
body { font-family: sans-serif;} h1 { color: #8b4500;} 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 Janaki Mandir. - A list (
<ul>or<ol>) with three<li>items, opened and closed correctly. - The photo shown with
<img src="janaki-mandir.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 free throw program, why is there a
whileloop inside theforloop? What would happen if its condition usedorinstead ofand? (2) - ii.In the entry fee program, how did Python’s error message lead you to the bug? Say what its last line told you, and what the lines above it told you. (2)
- iii.What does the rule
img { max-width: 100%; }do on a phone, and why is it needed? (2)
Answer
- i.The
forloop counts the 5 throws; thewhileloop inside asks again, as many times as needed, until one throw’s answer is allowed, so a typing mistake doesn’t use up a throw. Withor, the conditionresult != "in" or result != "out"would beTruefor every answer (no answer is both “in” and “out”), so it would keep asking forever: an infinite loop. - ii.The last line, read first, gives the kind of error and what went wrong: a NameError, the name
Feeis not defined, and Python even asks “Did you mean: 'fee'?”. The lines above it say where: line 3, printed with^^^underFee, the part that went wrong. So the bug is the capital F on line 3. - iii.It stops the photo from ever being wider than the space it is in, so on a narrow phone screen the photo shrinks to fit. Without it, a large photo is wider than the screen, and the visitor must scroll sideways to see it.
Marking scheme
- i. The
whileasks again until the answer isinorout, so a mistake doesn’t count as a throw. - i. With
or, the condition is always true, so it would ask forever (an infinite loop). - ii. The last line: the kind (NameError) and what went wrong (
Feeis not defined; did you meanfee). - ii. The line number above it (line 3), with the marks pointing at
Fee. - iii. The photo is never wider than the screen; it shrinks to fit a phone.
- iii. Without it, the photo would be too wide and the page would scroll sideways.
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.
