From 062670347f1aaac46ab61f0cbe3bbddcdcd4d3f4 Mon Sep 17 00:00:00 2001 From: Leo Litaize <litaizeleo40@gmail.com> Date: Fri, 10 Jan 2025 13:47:02 +0100 Subject: [PATCH] Question 1 --- main.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 2c24399..240bb91 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,11 @@ class TabletteChocolat: def __init__(self, m, n): - self.m = m - self.n = n + self.m=m + self.n=n + try: + self.m==int and self.n==int + except : + raise TypeError("Rentrer des entiers") + +a=TabletteChocolat(5.5,1) +print(a) -- GitLab