diff --git a/pythonProject/第二章/双分支结构1.py b/pythonProject/第二章/双分支结构1.py new file mode 100644 index 0000000..d5b7ae4 --- /dev/null +++ b/pythonProject/第二章/双分支结构1.py @@ -0,0 +1,5 @@ +number=eval(input("请输入幸运数字:")) +if number==1: + print("小孩") +else: + print("大孩子") \ No newline at end of file diff --git a/pythonProject/第二章/双分支结构2.py b/pythonProject/第二章/双分支结构2.py new file mode 100644 index 0000000..5cf5bd9 --- /dev/null +++ b/pythonProject/第二章/双分支结构2.py @@ -0,0 +1,3 @@ +number=eval(input("请输入幸运数字:")) +result="恭喜您中奖啦!" if number==1 else "hehe!" +print(result) \ No newline at end of file diff --git a/pythonProject/第二章/双分支结构3.py b/pythonProject/第二章/双分支结构3.py new file mode 100644 index 0000000..6535d5b --- /dev/null +++ b/pythonProject/第二章/双分支结构3.py @@ -0,0 +1,2 @@ +number=eval(input("请输入幸运数字:")) +print("您中奖了!" if number==1 else "hehe") \ No newline at end of file diff --git a/pythonProject/第二章/多分支结构2.py b/pythonProject/第二章/多分支结构2.py new file mode 100644 index 0000000..e69de29 diff --git a/pythonProject/第二章/多分支结构3.py b/pythonProject/第二章/多分支结构3.py new file mode 100644 index 0000000..e69de29 diff --git a/pythonProject/第二章/选择分支结构.py b/pythonProject/第二章/选择分支结构1.py similarity index 100% rename from pythonProject/第二章/选择分支结构.py rename to pythonProject/第二章/选择分支结构1.py diff --git a/pythonProject/第二章/选择分支结构2.py b/pythonProject/第二章/选择分支结构2.py new file mode 100644 index 0000000..e69de29 diff --git a/pythonProject/第二章/分支结构2.py b/pythonProject/第二章/选择分支结构3.py similarity index 100% rename from pythonProject/第二章/分支结构2.py rename to pythonProject/第二章/选择分支结构3.py