From 695b38ae82993c6d1eb3afad95472d088e94928a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E9=93=B6=E5=86=9B?= Date: Wed, 15 Oct 2025 17:45:08 +0800 Subject: [PATCH] no message --- pythonProject/test/2.py | 9 ++++----- pythonProject/第二章/while/1.py | 4 +++- pythonProject/第二章/while/2.py | 2 +- pythonProject/第二章/while/3.py | 0 4 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 pythonProject/第二章/while/3.py diff --git a/pythonProject/test/2.py b/pythonProject/test/2.py index 3b0aad9..c91c86e 100644 --- a/pythonProject/test/2.py +++ b/pythonProject/test/2.py @@ -1,7 +1,6 @@ s=0 -i=1 +i=0 while i<=100: - s+=i - i+=1 -else: - print(s) + s=i+s + i=i+1 +print(s) \ No newline at end of file diff --git a/pythonProject/第二章/while/1.py b/pythonProject/第二章/while/1.py index e899a32..2780be8 100644 --- a/pythonProject/第二章/while/1.py +++ b/pythonProject/第二章/while/1.py @@ -3,4 +3,6 @@ i=1 #初始值 while i<=100: #条件 s+=i #语句块 i+=1 -print(s) \ No newline at end of file +print(s) +print("-----") +print(i) \ No newline at end of file diff --git a/pythonProject/第二章/while/2.py b/pythonProject/第二章/while/2.py index 7351b7f..593d450 100644 --- a/pythonProject/第二章/while/2.py +++ b/pythonProject/第二章/while/2.py @@ -1,5 +1,5 @@ s=0 -i=1 #初始值 +i=0 #初始值 while i<=100: #条件 s+=i #语句块 i+=1 diff --git a/pythonProject/第二章/while/3.py b/pythonProject/第二章/while/3.py deleted file mode 100644 index e69de29..0000000