From 7dc8c35e36f89ac108197e9e25244649b137cc80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= <327782001@qq.com> Date: Thu, 1 Jun 2023 19:40:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=BE=AA=E7=8E=AF=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2\230_\346\261\2021-100\347\232\204\345\222\214.py" | 0 ...345\237\272\347\241\200\350\257\255\346\263\225.py" | 0 ...44\276\213-\347\214\234\346\225\260\345\255\227.py" | 2 +- ...345\265\214\345\245\227\345\272\224\347\224\250.py" | 3 --- ...344\271\235\344\271\230\346\263\225\350\241\250.py" | 8 +------- ...46\225\260\346\234\211\345\207\240\344\270\252a.py" | 10 ---------- ...345\237\272\347\241\200\350\257\255\346\263\225.py" | 0 .../08_range\350\257\255\345\217\245.py" | 0 ...351\207\217\344\275\234\347\224\250\345\237\237.py" | 4 +--- ...344\271\235\344\271\230\346\263\225\350\241\250.py" | 3 --- ...345\265\214\345\245\227\344\275\277\347\224\250.py" | 7 ------- ...345\276\252\347\216\257\344\270\255\346\226\255.py" | 0 ...44\276\213-\345\217\221\345\267\245\350\265\204.py" | 0 .../test.py" | 6 ------ 14 files changed, 3 insertions(+), 40 deletions(-) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_2_while\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230_\346\261\2021-100\347\232\204\345\222\214.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_while\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230_\346\261\2021-100\347\232\204\345\222\214.py" (100%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/02_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" (100%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/02_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\346\241\210\344\276\213-\347\214\234\346\225\260\345\255\227.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/03_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\346\241\210\344\276\213-\347\214\234\346\225\260\345\255\227.py" (100%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/03_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\345\272\224\347\224\250.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/04_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\345\272\224\347\224\250.py" (99%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/04_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\346\241\210\344\276\213-\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\346\241\210\344\276\213-\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" (84%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_2_for\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230-\346\225\260\344\270\200\346\225\260\346\234\211\345\207\240\344\270\252a.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/06_for\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230-\346\225\260\344\270\200\346\225\260\346\234\211\345\207\240\344\270\252a.py" (97%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_for\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/07_for\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" (100%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/06_range\350\257\255\345\217\245.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_range\350\257\255\345\217\245.py" (100%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/07_\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/09_\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.py" (89%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_2_for\345\276\252\347\216\257\346\211\223\345\215\260\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/10_for\345\276\252\347\216\257\346\211\223\345\215\260\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" (99%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_for\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\344\275\277\347\224\250.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/11_for\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\344\275\277\347\224\250.py" (98%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/09_\345\276\252\347\216\257\344\270\255\346\226\255.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/12_\345\276\252\347\216\257\344\270\255\346\226\255.py" (100%) rename "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/10_\345\276\252\347\216\257\347\273\274\345\220\210\346\241\210\344\276\213-\345\217\221\345\267\245\350\265\204.py" => "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/13_\345\276\252\347\216\257\347\273\274\345\220\210\346\241\210\344\276\213-\345\217\221\345\267\245\350\265\204.py" (100%) delete mode 100644 "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/test.py" diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_2_while\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230_\346\261\2021-100\347\232\204\345\222\214.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_while\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230_\346\261\2021-100\347\232\204\345\222\214.py" similarity index 100% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_2_while\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230_\346\261\2021-100\347\232\204\345\222\214.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_while\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230_\346\261\2021-100\347\232\204\345\222\214.py" diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/02_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" similarity index 100% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/01_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/02_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/02_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\346\241\210\344\276\213-\347\214\234\346\225\260\345\255\227.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/03_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\346\241\210\344\276\213-\347\214\234\346\225\260\345\255\227.py" similarity index 100% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/02_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\346\241\210\344\276\213-\347\214\234\346\225\260\345\255\227.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/03_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\346\241\210\344\276\213-\347\214\234\346\225\260\345\255\227.py" index 35512cf..ec4c8ea 100644 --- "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/02_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\346\241\210\344\276\213-\347\214\234\346\225\260\345\255\227.py" +++ "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/03_while\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\346\241\210\344\276\213-\347\214\234\346\225\260\345\255\227.py" @@ -4,6 +4,7 @@ # 获取范围在1-100的随机数字 import random + num = random.randint(1, 100) # 定义一个变量,记录总共猜测了多少次 count = 0 @@ -24,4 +25,3 @@ while flag: print("你猜的小了") print(f"你总共猜测了{count}次") - diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/03_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\345\272\224\347\224\250.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/04_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\345\272\224\347\224\250.py" similarity index 99% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/03_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\345\272\224\347\224\250.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/04_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\345\272\224\347\224\250.py" index 32c89bf..ff49a14 100644 --- "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/03_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\345\272\224\347\224\250.py" +++ "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/04_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\345\272\224\347\224\250.py" @@ -8,15 +8,12 @@ i = 1 while i <= 100: print(f"今天是第{i}天,准备表白.....") - # 内层循环的控制变量 j = 1 while j <= 10: print(f"送给小美第{j}只玫瑰花") j += 1 - print("小美,我喜欢你") i += 1 - print(f"坚持到第{i - 1}天,表白成功") diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/04_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\346\241\210\344\276\213-\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\346\241\210\344\276\213-\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" similarity index 84% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/04_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\346\241\210\344\276\213-\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\346\241\210\344\276\213-\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" index 96fbf23..ed74a33 100644 --- "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/04_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\346\241\210\344\276\213-\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" +++ "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_while\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\346\241\210\344\276\213-\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" @@ -2,20 +2,14 @@ 演示使用while的嵌套循环 打印输出九九乘法表 """ - # 定义外层循环的控制变量 i = 1 while i <= 9: - # 定义内层循环的控制变量 j = 1 while j <= i: # 内层循环的print语句,不要换行,通过\t制表符进行对齐 print(f"{j} * {i} = {j * i}\t", end='') j += 1 - i += 1 - print() # print空内容,就是输出一个换行 - - - + print() # print空内容,就是输出一个换行 diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_2_for\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230-\346\225\260\344\270\200\346\225\260\346\234\211\345\207\240\344\270\252a.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/06_for\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230-\346\225\260\344\270\200\346\225\260\346\234\211\345\207\240\344\270\252a.py" similarity index 97% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_2_for\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230-\346\225\260\344\270\200\346\225\260\346\234\211\345\207\240\344\270\252a.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/06_for\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230-\346\225\260\344\270\200\346\225\260\346\234\211\345\207\240\344\270\252a.py" index 7bcd4f3..77cf1ab 100644 --- "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_2_for\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230-\346\225\260\344\270\200\346\225\260\346\234\211\345\207\240\344\270\252a.py" +++ "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/06_for\345\276\252\347\216\257\347\273\203\344\271\240\351\242\230-\346\225\260\344\270\200\346\225\260\346\234\211\345\207\240\344\270\252a.py" @@ -3,21 +3,11 @@ """ # 统计如下字符串中,有多少个字母a name = "itheima is a brand of itcast" - # 定义一个变量,用来统计有多少个a count = 0 - # for 循环统计 # for 临时变量 in 被统计的数据: for x in name: if x == "a": count += 1 - print(f"被统计的字符串中有{count}个a") - - - - - - - diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_for\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/07_for\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" similarity index 100% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/05_for\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/07_for\345\276\252\347\216\257\347\232\204\345\237\272\347\241\200\350\257\255\346\263\225.py" diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/06_range\350\257\255\345\217\245.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_range\350\257\255\345\217\245.py" similarity index 100% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/06_range\350\257\255\345\217\245.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_range\350\257\255\345\217\245.py" diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/07_\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/09_\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.py" similarity index 89% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/07_\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/09_\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.py" index b9c91d5..7114c4a 100644 --- "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/07_\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.py" +++ "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/09_\345\217\230\351\207\217\344\275\234\347\224\250\345\237\237.py" @@ -4,6 +4,4 @@ i = 0 for i in range(5): print(i) - -print(i) - +print(i) \ No newline at end of file diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_2_for\345\276\252\347\216\257\346\211\223\345\215\260\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/10_for\345\276\252\347\216\257\346\211\223\345\215\260\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" similarity index 99% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_2_for\345\276\252\347\216\257\346\211\223\345\215\260\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/10_for\345\276\252\347\216\257\346\211\223\345\215\260\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" index d1ad539..6efb301 100644 --- "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_2_for\345\276\252\347\216\257\346\211\223\345\215\260\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" +++ "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/10_for\345\276\252\347\216\257\346\211\223\345\215\260\344\271\235\344\271\235\344\271\230\346\263\225\350\241\250.py" @@ -1,14 +1,11 @@ """ 演示for循环打印九九乘法表 """ - # 通过外层循环控制行数 for i in range(1, 10): # 通过内层循环控制每一行的数据 for j in range(1, i + 1): # 在内层循环中输出每一行的内容 print(f"{j} * {i} = {j * i}\t", end='') - # 外层循环可以通过print输出一个回车符 print() - diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_for\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\344\275\277\347\224\250.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/11_for\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\344\275\277\347\224\250.py" similarity index 98% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_for\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\344\275\277\347\224\250.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/11_for\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\344\275\277\347\224\250.py" index d8131f3..a5e6988 100644 --- "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_for\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\344\275\277\347\224\250.py" +++ "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/11_for\345\276\252\347\216\257\347\232\204\345\265\214\345\245\227\344\275\277\347\224\250.py" @@ -1,20 +1,13 @@ """ 演示嵌套应用for循环 """ - # 坚持表白100天,每天都送10朵花 # range i = 0 for i in range(1, 101): print(f"今天是向小美表白的第{i}天,加油坚持。") - # 写内层的循环了 for j in range(1, 11): print(f"给小美送的第{j}朵玫瑰花") - print("小美我喜欢你") - print(f"第{i}天,表白成功") - - - diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/09_\345\276\252\347\216\257\344\270\255\346\226\255.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/12_\345\276\252\347\216\257\344\270\255\346\226\255.py" similarity index 100% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/09_\345\276\252\347\216\257\344\270\255\346\226\255.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/12_\345\276\252\347\216\257\344\270\255\346\226\255.py" diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/10_\345\276\252\347\216\257\347\273\274\345\220\210\346\241\210\344\276\213-\345\217\221\345\267\245\350\265\204.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/13_\345\276\252\347\216\257\347\273\274\345\220\210\346\241\210\344\276\213-\345\217\221\345\267\245\350\265\204.py" similarity index 100% rename from "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/10_\345\276\252\347\216\257\347\273\274\345\220\210\346\241\210\344\276\213-\345\217\221\345\267\245\350\265\204.py" rename to "04_Python\345\276\252\347\216\257\350\257\255\345\217\245/13_\345\276\252\347\216\257\347\273\274\345\220\210\346\241\210\344\276\213-\345\217\221\345\267\245\350\265\204.py" diff --git "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/test.py" "b/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/test.py" deleted file mode 100644 index 7b02e54..0000000 --- "a/04_Python\345\276\252\347\216\257\350\257\255\345\217\245/test.py" +++ /dev/null @@ -1,6 +0,0 @@ - -# print("Hello", end='') -# print("world", end='') - -print("Hello\tWorld") -print("itheima\tbest") -- GitLab