Level 3: Expert
Complex Logic (6 Marks+)
1. Ticket Sales System (6 Marks)
There are 500 tickets.
1. Ask user for number of tickets.
2. If enough left, print "Booked" and deduct from total.
3. Else print "Not enough".
4. Repeat until tickets are 0.
Examiner's Notes
- 1 Mark: Correct If condition (checking
wanted <= tickets). - 1 Mark: Deducting tickets correctly.
- 1 Mark: Correct Else message.
- 1 Mark: Loop structure valid.
2. Voting System (6 Marks)
Continually ask for a vote ("A", "B", or "C").
Keep track of counts for each.
Stop if user types "END".
Print totals at the end.
Examiner's Notes
- 1 Mark: Initializing counters to 0.
- 1 Mark: While loop checking "END".
- 1 Mark: Valid logic for counting A, B, and C.
- 1 Mark: Printing final results.
3. Attendance Register (6 Marks)
Loop through the list of students.
For each, ask "Present?" (y/n).
Count how many are present. Return total.
Examiner's Notes
- 1 Mark: Iterating list with For Loop.
- 1 Mark: Input inside the loop.
- 1 Mark: If statement checking "y".
- 1 Mark: Incrementing counter.
4. Memory Game (6 Marks)
The array slots has empty spots ("") and taken spots ("A").
Ask user for a slot number (0-4).
If slots[num] is "", set it to "B" (Player B).
Else print "Taken".
Examiner's Notes
- 1 Mark: Taking integer input.
- 1 Mark: Accessing array index correctly.
- 1 Mark: Checking if empty (
== ""). - 1 Mark: Updating array value.
5. Charging Time (6 Marks)
A battery charges 1% every 10 mins.
Ask for current percentage. Calc needed (100 - current).
Calc total minutes needed.
Convert to Hours and Minutes (Helper: mins // 60 is hours,
mins % 60 is minutes).
Examiner's Notes
- 1 Mark: Calculating needed charge.
- 1 Mark: Calculating total minutes (* 10).
- 1 Mark: Using floor division
//for hours. - 1 Mark: Using modulo
%for minutes.
6. Best Wage (6 Marks)
Calculate two wages options:
1. Piecework: 2.00 per bear.
2. Hourly: 5.00 per hour.
Output the Higher wage.
Examiner's Notes
- 1 Mark: Calculating Wage 1 correctly.
- 1 Mark: Calculating Wage 2 correctly.
- 1 Mark: Comparing W1 and W2.
- 1 Mark: Printing the larger value.
13. Sorting Logic (2 Marks)
If nums[0] is greater than nums[1], swap them. Print the list.
Examiner's Notes
- 1 Mark: Comparing elements.
- 1 Mark: Swapping logic (temp variable or pythonic swap).
14. 2D List Sum (4 Marks)
Calculate the total sum of all numbers in the 2D list `matrix`.
Examiner's Notes
- 1 Mark: Outer loop iter rows.
- 1 Mark: Inner loop iter cols.
- 1 Mark: Accumulating total correctly.
- 1 Mark: Final print.
15. Dictionary Access (1 Mark)
Print the value associated with the key "Name".
Examiner's Notes
- 1 Mark: accessing dict key `user["Name"]`.
16. Dictionary Add (1 Mark)
Add a new key "Score" with value 100 to the dictionary.
Examiner's Notes
- 1 Mark: Correct assignment syntax `dict[key] = value`.
17. Count Vowels (2 Marks)
Count occurrences of 'a', 'e', 'i', 'o', 'u' in the string.
Examiner's Notes
- 1 Mark: Looping through string.
- 1 Mark: Checking if char in vowels string.
18. Palindrome (2 Marks)
Check if the string is the same forwards and backwards.
Examiner's Notes
- 1 Mark: Creating reversed string.
- 1 Mark: Comparing original with reversed.
19. File Iteration (2 Marks)
Simulate looping through lines in a file.
Examiner's Notes
- 1 Mark: Loop structure.
- 1 Mark: Printing line loop variable.
20. Simple Menu (3 Marks)
If choice is "1", print "Play". If "2", print "Exit".
Examiner's Notes
- 1 Mark: Checking choice "1".
- 1 Mark: Checking choice "2".
- 1 Mark: Correct print outputs.
21. Email Validation (2 Marks)
Check if email contains "@" AND ".".
Examiner's Notes
- 1 Mark: Checking for "@".
- 1 Mark: Checking for ".".
22. CSV Parsing (1 Mark)
Split the string "A,B,C" by comma.
Examiner's Notes
- 1 Mark: Using
.split(",")correctly.
23. State Machines (1 Mark)
If state is "Red", set state to "Green".
Examiner's Notes
- 1 Mark: Updating state variable.
24. Game Choice (3 Marks)
If p1 is "Rock" and p2 is "Scissors", print "Win".
Examiner's Notes
- 1 Mark: Checking p1 condition.
- 1 Mark: Checking p2 condition.
- 1 Mark: Correct comparison logic.
7. Coffee Order (6 Marks)
Medium costs 3.00, Large costs 3.50.
Add 0.50 for "Shot".
Calculate total.
Examiner's Notes
- 1 Mark: Setting base price based on size.
- 1 Mark: Checking extra condition.
- 1 Mark: Adding to price correctly.
8. High Score (7 Marks)
Find the highest score in the list manually (don't use max()).
Examiner's Notes
- 1 Mark: Initializing variable `high`.
- 1 Mark: Looping through `scores`.
- 1 Mark: Checking
if s > high. - 1 Mark: Updating `high` variable.
9. Log File (6 Marks)
Open "log.txt", write "Log Entry" to it, and close.
Examiner's Notes
- 1 Mark: Opening file in "w" (write) mode.
- 1 Mark: Using
.write()method. - 1 Mark: Writing correct string.
- 1 Mark: Closing file.
10. Parse Email (5 Marks)
Extract the domain (after @) from email.
Examiner's Notes
- 1 Mark: Using
.split()correctly. - 1 Mark: Accessing the last element (index 1 or -1).
- 1 Mark: Printing the result.
11. Nested Loops (7 Marks)
Print a 3x3 grid of stars (*).
Examiner's Notes
- 1 Mark: Correct outer loop.
- 1 Mark: Correct inner loop.
- 1 Mark: Constructing or printing the line.
12. Time Conversion (6 Marks)
Convert 125 seconds into minutes and seconds (e.g., "2m 5s").
Examiner's Notes
- 1 Mark: Using integer division
//for minutes. - 1 Mark: Using modulo
%for seconds. - 1 Mark: Using
str()+ concatenation or commas.