From 40b6112a200f8c9ae466c7cb6fa26fb6053f3945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E9=93=B6=E5=86=9B?= Date: Mon, 20 Oct 2025 17:25:33 +0800 Subject: [PATCH] no message --- pythonProject/test/{7.py => 7_1.py} | 0 pythonProject/test/7_2.py | 5 +++++ pythonProject/test/7_3.py | 3 +++ pythonProject/test/7_4.py | 4 ++++ pythonProject/基础/isinstance.py | 5 +++++ 5 files changed, 17 insertions(+) rename pythonProject/test/{7.py => 7_1.py} (100%) create mode 100644 pythonProject/test/7_2.py create mode 100644 pythonProject/test/7_3.py create mode 100644 pythonProject/test/7_4.py create mode 100644 pythonProject/基础/isinstance.py diff --git a/pythonProject/test/7.py b/pythonProject/test/7_1.py similarity index 100% rename from pythonProject/test/7.py rename to pythonProject/test/7_1.py diff --git a/pythonProject/test/7_2.py b/pythonProject/test/7_2.py new file mode 100644 index 0000000..8ed95fc --- /dev/null +++ b/pythonProject/test/7_2.py @@ -0,0 +1,5 @@ +num = eval(input('请输入幸运数字:')) +if num<=18: + print("呵呵!") +if not num<=18: + print("哈哈!") \ No newline at end of file diff --git a/pythonProject/test/7_3.py b/pythonProject/test/7_3.py new file mode 100644 index 0000000..a7baa72 --- /dev/null +++ b/pythonProject/test/7_3.py @@ -0,0 +1,3 @@ +num = eval(input('请输入幸运数字:')) +if num<=18 or num>100: + print("xxx") \ No newline at end of file diff --git a/pythonProject/test/7_4.py b/pythonProject/test/7_4.py new file mode 100644 index 0000000..127b3d1 --- /dev/null +++ b/pythonProject/test/7_4.py @@ -0,0 +1,4 @@ +str1 =eval( input('请输入1:')) +str2 = eval(input('请输入2:')) +if str1>1 and str2>1: + print("xxx") diff --git a/pythonProject/基础/isinstance.py b/pythonProject/基础/isinstance.py new file mode 100644 index 0000000..afb2a33 --- /dev/null +++ b/pythonProject/基础/isinstance.py @@ -0,0 +1,5 @@ +f = input('请输入:') +print(type(f)) +print(isinstance(f,str)) +print('---') +print(isinstance(eval(f),int))