From 6767aefa4e77b6b4ca77c87516bc954347f29166 Mon Sep 17 00:00:00 2001 From: Samuel Vermeulen Date: Fri, 6 Jan 2023 12:25:35 +0100 Subject: [PATCH] up --- Fonctions/formes_creuses.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Fonctions/formes_creuses.py diff --git a/Fonctions/formes_creuses.py b/Fonctions/formes_creuses.py new file mode 100644 index 0000000..97f4167 --- /dev/null +++ b/Fonctions/formes_creuses.py @@ -0,0 +1,23 @@ +#Ligne +def ligne(longueur: int): + for loop in range(longueur): + print("X", end="") + print() + +#Rectangle +def rectangle(lignes: int, colonnes: int): + for ligne in range(lignes): + if ligne > 0 and ligne < lignes - 1: + print("#", end="") + for colonne in range(colonnes - 2): + print(" ", end="") + print("#", end="") + else: + for colonne in range(colonnes): + print("#", end="") + print() + + + +#ligne(int(input())) +rectangle(10, 20) \ No newline at end of file