From 7eda1d2fc5c08570871628ba61f3ed1293fb2d11 Mon Sep 17 00:00:00 2001 From: MX <3037347690@qq.com> Date: Sun, 4 Oct 2026 14:54:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8for=E5=BE=AA=E7=8E=AF?= =?UTF-8?q?=E9=80=90=E4=B8=AA=E8=B0=83=E7=94=A8area=E5=B9=B6=E4=B8=94?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E9=9D=A2=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 国庆考核.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/国庆考核.py b/国庆考核.py index 328be32..391790d 100644 --- a/国庆考核.py +++ b/国庆考核.py @@ -17,3 +17,5 @@ class Square(Shape): r = int(input("请输入圆的半径: ")) side = int(input("请输入正方形的边长: ")) shapes = [Circle(r), Square(side)] +for i in shapes: + print(i.__class__.__name__ + "的面积为: " + str(i.area())) \ No newline at end of file