From 36b0a73155bb42054bde1e88f638dc0929b274e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Sat, 14 Oct 2023 10:22:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 15_test_practice/{01_demo2.py => 02_demo.py} | 0 15_test_practice/03_demo.py | 7 +++++++ 2 files changed, 7 insertions(+) rename 15_test_practice/{01_demo2.py => 02_demo.py} (100%) create mode 100644 15_test_practice/03_demo.py diff --git a/15_test_practice/01_demo2.py b/15_test_practice/02_demo.py similarity index 100% rename from 15_test_practice/01_demo2.py rename to 15_test_practice/02_demo.py diff --git a/15_test_practice/03_demo.py b/15_test_practice/03_demo.py new file mode 100644 index 0000000..2b25fed --- /dev/null +++ b/15_test_practice/03_demo.py @@ -0,0 +1,7 @@ +set1 = {1, 2, 3} +set2 = {1, 2, 3} + +# 使用 issuperset 方法检查 set1 是否是 set2 的超集 +result = set1.issuperset(set2) + +print(result) # 这将输出 True,因为 set1 包含了 set2 中的所有元素 -- GitLab