This project is part of the 42 School Common Core and serves as an introduction to Python fundamentals.
The goal of this module is to learn basic Python syntax and concepts such as:
- functions
- input and output
- variables and types
- conditional statements
- loops and recursion
- basic string manipulation
- type annotations
Each exercise consists of a single function, written according to the subject rules,
and tested using a provided main.py helper.
Each exercise is placed in its own directory (ex0 to ex7) and contains only the
requested function(s), with no main program.
Displays a welcome message.
- Introduces basic function definition and
print().
Asks for the length and width of a garden plot and prints its area.
- Introduces user input, integer conversion, and basic arithmetic.
Asks for harvest weights from three different days and prints the total.
- Practices addition and variable usage.
Checks if a plant is ready to harvest based on its age.
- Introduces conditional logic (
if / else).
Prints a reminder depending on how many days have passed since the last watering.
- Reinforces conditional statements and exact output formatting.
Prints each day until harvest time using:
- an iterative approach
- a recursive approach
This exercise demonstrates the difference between loops and recursion.
Prints a simple summary of a garden using user-provided information.
- Combines multiple inputs into formatted output.
Displays seed inventory information based on provided arguments and units.
- Introduces function parameters
- Uses type annotations
- Focuses on precise string formatting
- All code follows Python 3.10+ and flake8 standards, as requested by 42 school.
- Outputs must match the subject examples exactly.
- This module focuses on clarity, correctness, and understanding rather than complexity.