Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

🌱 Python Module 00

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.


📁 Project Structure

Each exercise is placed in its own directory (ex0 to ex7) and contains only the requested function(s), with no main program.


📌 Exercises Overview

Exercise 0 — Hello Garden

Displays a welcome message.

  • Introduces basic function definition and print().

Exercise 1 — Garden Plot Area

Asks for the length and width of a garden plot and prints its area.

  • Introduces user input, integer conversion, and basic arithmetic.

Exercise 2 — Harvest Total

Asks for harvest weights from three different days and prints the total.

  • Practices addition and variable usage.

Exercise 3 — Plant Age Check

Checks if a plant is ready to harvest based on its age.

  • Introduces conditional logic (if / else).

Exercise 4 — Water Reminder

Prints a reminder depending on how many days have passed since the last watering.

  • Reinforces conditional statements and exact output formatting.

Exercise 5 — Count to Harvest

Prints each day until harvest time using:

  • an iterative approach
  • a recursive approach

This exercise demonstrates the difference between loops and recursion.


Exercise 6 — Garden Summary

Prints a simple summary of a garden using user-provided information.

  • Combines multiple inputs into formatted output.

Exercise 7 — Seed Inventory

Displays seed inventory information based on provided arguments and units.

  • Introduces function parameters
  • Uses type annotations
  • Focuses on precise string formatting

✅ Notes

  • 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.