Practical Bac
Train for the practical computer-science exam in Python: write each function, check it against tests, then sit a timed mock exam scored out of 20.
Choose your year
Choose your section
4 subjects
- Bac-style subject60 min4 questions
Perfect numbers
A number is perfect when it equals the sum of its proper divisors (all its divisors except itself). Example: 28 = 1 + 2 + 4 + 7 + 14.
- Bac Computer science
- Algorithms
- Functions & procedures
- Python
- Bac-style subject60 min4 questions
Caesar cipher
The Caesar cipher shifts every letter of a word by k positions in the alphabet; after Z we come back to A. Example with k = 3: HELLO becomes KHOOR.
- Bac Computer science
- Arrays & strings
- Functions & procedures
- Python
- Bac-style subject60 min4 questions
Marks and average
We want to analyse the marks (out of 20) of a group of students: compute the average and count the marks above it.
- Bac Mathematics
- Bac Experimental sciences
- Bac Technical sciences
- Arrays & strings
- Functions & procedures
- Python
- Bac-style subject60 min4 questions
Twin primes
Two prime numbers p and p + 2 are called twin primes, for example (11, 13). We want to list all twin primes up to n.
- Bac Mathematics
- Bac Experimental sciences
- Bac Technical sciences
- Algorithms
- Functions & procedures
- Python
Original subjects written in the style of the Tunisian Bac practical exam — not official papers. Durations are indicative. Your code runs in your browser and is checked there, so the score is for practice only.