Warning
At the request of the 42 Network, this repository no longer contains the real Rank 04 exam subjects or solutions. The PracticeShell now uses original exercises. They are great for training, but they are not the actual exam questions.
This repository is a growing bank of exercises for the topics learned during Milestone 4 of the Python Common Core.
The goal is to help you:
- Train the topics you learned during the milestone
- Review your doubts and find your weak points
- Prepare for the exam by practicing under time and test pressure.
New exercises will be added over time. Each one focuses on a concept learned during this milestone.
Quick Start β’ Features β’ Performance β’ Exam Mode β’ Practice Mode β’ Solutions
A Python-based PracticeShell simulator inspired by the new 42 School Common Core Rank 04 learning material, combined with a collection of organized solutions grouped by difficulty level.
Clone the repository:
git clone https://github.com/SaraFreitas-dev/42-Python-ExamShell-Rank04
cd 42-Python-ExamShell-Rank04Run the PracticeShell:
python3 practiceshell.pyYou will be presented with the main menu:
[1] Start Exam
[2] Practice Mode
[3] List all exercises
[q] Quit
No dependencies, no setup: just Python 3.
When the PracticeShell starts, it automatically creates an exam_workspace directory.
All exercise files should be created inside this folder. The grader will only validate solutions placed in the generated workspace.
Example:
exam_workspace/
βββ py_move_zeros_end.py
Simply create the requested file, implement your solution, and submit it through the PracticeShell interface for automatic evaluation.
The PracticeShell is the core of this repository.
It lets you practice each milestone topic hands-on, with hidden tests and automatic feedback, instead of just reading solutions.
| Grading | Exam experience | Interface |
|---|---|---|
| Automatic grading | Random exercise assignment | Colored terminal UI |
| Hidden test cases | Progressive level system | Score tracking |
| Performance tests with timeout | Exam & practice modes | Time tracking |
| Forbidden function rules | Rank progression logic | Pure Python |
The workflow:
- Receive a subject
- Create the requested Python file
- Implement the solution
- Submit for grading
- Fix failing tests
- Progress to the next level
Many exercises require solutions that are not only correct, but also efficient.
Some exercises include large hidden inputs. If your solution takes too long, the test is marked as [TIMEOUT], even if the result would eventually be correct:
β KO count_pairs_sum([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15...
expected: 5000
got : '[TIMEOUT]'
π‘ If you get a timeout, review the complexity of your approach rather than the correctness of the output.
Select:
[1] Start Exam
The simulator will:
- Assign exercises automatically
- Increase difficulty after each successful exercise
- Track your score
- Simulate a 3-hour exam session
The simulator uses a progressive difficulty system. To successfully complete the exam you must validate:
4 / 4 exercises
Select:
[2] Practice Mode
Practice Mode allows you to:
- Choose any exercise
- Focus on a specific level
- Submit unlimited times
- Train without time pressure
Solutions are organized by level and include the completed exercises.
solutions/
βββ level_1
βββ level_2
βββ level_3
βββ level_4
This makes it easy to study specific difficulty ranges or review previously solved exercises.
β οΈ Try each exercise in the PracticeShell first. Reading solutions before attempting them will not show you where your weak points are.
- Lists and nested lists
- Two-pointer techniques
- Sorted sequences and intervals
- Algorithmic efficiency and time complexity
- Implementing algorithms without forbidden built-ins (
sorted(),.sort(),heapq) - Edge case handling
- Algorithmic thinking
This project is an independent educational tool. It is not affiliated with or endorsed by 42 School, and it does not contain any official 42 exam content.
Found a bug, a missing test case or have an idea? Feel free to open an issue.
Good luck and happy coding π



