From 21b5fdecf49a81491408921bbbeae80e10b15e41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=A6=E8=8B=B1=E6=9D=B0?= Date: Sun, 21 Jul 2024 18:09:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=9F=BA=E7=A1=80=E8=AF=AD=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/inspectionProfiles/Project_Default.xml | 75 +- .idea/material_theme_project_new.xml | 5 +- .idea/misc.xml | 5 +- .idea/modules.xml | 8 - .idea/python-demo.iml | 4 - .idea/vcs.xml | 2 +- .idea/workspace.xml | 726 +++--------------- ...55\347\232\204\346\263\250\351\207\212.py" | 6 +- ...60\346\215\256\347\261\273\345\236\213.py" | 8 +- ...62\346\240\274\345\274\217\345\214\226.py" | 2 + ...03\350\277\220\347\256\227\347\254\246.py" | 7 + ...45\347\232\204\344\275\277\347\224\250.py" | 3 - ...6\261\2021-100\347\232\204\345\222\214.py" | 4 +- ...0\346\234\211\345\207\240\344\270\252a.py" | 5 +- ...72\347\241\200\350\257\255\346\263\225.py" | 4 +- .../08_range\350\257\255\345\217\245.py" | 12 +- ...52\347\216\257\344\270\255\346\226\255.py" | 16 +- 17 files changed, 213 insertions(+), 679 deletions(-) delete mode 100644 .idea/modules.xml diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index c24a62e..14d4046 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -1,19 +1,90 @@ \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml index ed57dc9..5a2422a 100644 --- a/.idea/material_theme_project_new.xml +++ b/.idea/material_theme_project_new.xml @@ -3,7 +3,10 @@ diff --git a/.idea/misc.xml b/.idea/misc.xml index d3fcfad..5d64945 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,7 @@ - + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 9bd1038..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/python-demo.iml b/.idea/python-demo.iml index dcda5dd..ec63674 100644 --- a/.idea/python-demo.iml +++ b/.idea/python-demo.iml @@ -1,9 +1,5 @@ - - - - - + + + + + + + + + + + + + + + + + + + - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - + - + - + - - - - - + + + + + + + + + + + - - 1685454725760 + + 1721555336016 - - 1685618936695 - - - 1685619627439 - - - 1685620198764 - - - 1685620356134 - - - 1685669428559 - - - 1685671192692 - - - 1685673026799 - - - 1687139940478 - - - 1687173352050 - - - 1687318751340 - - - 1687318928710 - - - 1687324078675 - - - 1687325334757 - - - 1687357444795 - - - 1687357458321 - - - 1687358862566 - - - 1687393762651 - - - 1687397048910 - - - 1687415835158 - - - 1687415851614 - - - 1687478937306 - - - 1687478988169 - - - 1687479016565 - - - 1687479045626 - - - 1687490450074 - - - 1687504471409 - - - 1687603516986 - - - 1687605684640 - - - 1687656979434 - - - 1687664499896 - - - 1687760225246 - - - 1687834876731 - - - 1687837970479 - - - 1687837984658 - - - 1687968690748 - - - 1688022979342 - - - 1688052111962 - - - 1688119958139 - - - 1688181071294 - - - 1688187135332 - - - 1688210028252 - - - 1688236215519 - - - 1688265929552 - - - 1688268634424 - - - 1688346828068 - - - 1688346838347 - - - 1688347105382 - - - 1688438009416 - - - 1688438231472 - - - - - - - - - - - - file://$PROJECT_DIR$/04_函数/11_函数综合案例.py - 50 - - - file://$PROJECT_DIR$/04_函数/11_函数综合案例.py - 39 - - - file://$PROJECT_DIR$/04_函数/11_函数综合案例.py - 29 - - - file://$PROJECT_DIR$/14_刷题/01-数组/day01/problem_solving_08.py - 17 - - - file://$PROJECT_DIR$/14_刷题/01-数组/day01/problem_solving_08.py - 20 - - - file://$PROJECT_DIR$/14_刷题/01-数组/day03/problem_solving_27_02.py - 9 - - - file://$PROJECT_DIR$/14_刷题/01-数组/day03/problem_solving_27_02.py - 27 - - - file://$PROJECT_DIR$/14_刷题/02-链表/problem_solving_01.py - 52 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git "a/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/02_Python\344\270\255\347\232\204\346\263\250\351\207\212.py" "b/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/02_Python\344\270\255\347\232\204\346\263\250\351\207\212.py" index bd18cd4..c555be3 100644 --- "a/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/02_Python\344\270\255\347\232\204\346\263\250\351\207\212.py" +++ "b/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/02_Python\344\270\255\347\232\204\346\263\250\351\207\212.py" @@ -1,12 +1,17 @@ name = """ 多行注释 """ + +""" +WEFSFSDFWF +""" print(name) # 写一个整数字面量 666 # 写一个浮点数字面量 13.14 +# 222 # 写一个字符串字面量 "程序员" @@ -14,7 +19,6 @@ print(name) print(666) print(13.14) print("程序员") - # 单行注释 # # diff --git "a/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/04_Python\344\270\255\347\232\204\346\225\260\346\215\256\347\261\273\345\236\213.py" "b/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/04_Python\344\270\255\347\232\204\346\225\260\346\215\256\347\261\273\345\236\213.py" index bc21665..a439509 100644 --- "a/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/04_Python\344\270\255\347\232\204\346\225\260\346\215\256\347\261\273\345\236\213.py" +++ "b/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/04_Python\344\270\255\347\232\204\346\225\260\346\215\256\347\261\273\345\236\213.py" @@ -1,18 +1,18 @@ # 方式1: 使用print直接输出类型信息 print(type("程序员")) -print(type(666)) +int_type = type(666) +print(int_type) print(type(11.345)) - # 方式2: 使用变量存储type()语句的结果 string_type = type("程序员") -int_type = type(666) +int_type = int_type float_type = type(11.345) + print(string_type) print(int_type) print(float_type) - # 方式3: 使用type()语句,查看变量中存储的数据类型信息 name = "程序员" name_type = type(name) diff --git "a/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/08_Python\347\232\204\345\255\227\347\254\246\344\270\262\346\240\274\345\274\217\345\214\226.py" "b/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/08_Python\347\232\204\345\255\227\347\254\246\344\270\262\346\240\274\345\274\217\345\214\226.py" index 146493e..e1156fd 100644 --- "a/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/08_Python\347\232\204\345\255\227\347\254\246\344\270\262\346\240\274\345\274\217\345\214\226.py" +++ "b/01_Python\345\205\245\351\227\250\350\257\255\346\263\225/08_Python\347\232\204\345\255\227\347\254\246\344\270\262\346\240\274\345\274\217\345\214\226.py" @@ -21,3 +21,5 @@ print("数字11宽度限制5,结果是:%5d" % num1) print("数字11宽度限制1,结果是:%1d" % num1) print("数字11.345宽度限制7,小数精度2,结果是:%7.2f" % num2) print("数字11.345不限制,小数精度2,结果是:%.2f" % num2) + +print(f"message = {name},成立于:{setup_year},我今天的股价是:{stock_price}") \ No newline at end of file diff --git "a/02_Python\345\210\244\346\226\255\350\257\255\345\217\245/01_\345\270\203\345\260\224\347\261\273\345\236\213\345\222\214\346\257\224\350\276\203\350\277\220\347\256\227\347\254\246.py" "b/02_Python\345\210\244\346\226\255\350\257\255\345\217\245/01_\345\270\203\345\260\224\347\261\273\345\236\213\345\222\214\346\257\224\350\276\203\350\277\220\347\256\227\347\254\246.py" index 692197b..223fd3c 100644 --- "a/02_Python\345\210\244\346\226\255\350\257\255\345\217\245/01_\345\270\203\345\260\224\347\261\273\345\236\213\345\222\214\346\257\224\350\276\203\350\277\220\347\256\227\347\254\246.py" +++ "b/02_Python\345\210\244\346\226\255\350\257\255\345\217\245/01_\345\270\203\345\260\224\347\261\273\345\236\213\345\222\214\346\257\224\350\276\203\350\277\220\347\256\227\347\254\246.py" @@ -4,9 +4,16 @@ """ # 定义变量存储布尔类型的数据 bool_1 = True +# +# if today == 21: +# bool_1 = False + +print(f"bool_1={bool_1}") + bool_2 = False print(f"bool_1变量的内容是:{bool_1}, 类型是:{type(bool_1)}") print(f"bool_2变量的内容是:{bool_2}, 类型是:{type(bool_2)}") + # 比较运算符的使用 # == , !=, >, <, >=, <= # 演示进行内容的相等比较 diff --git "a/02_Python\345\210\244\346\226\255\350\257\255\345\217\245/05_if_elif_else\350\257\255\345\217\245\347\232\204\344\275\277\347\224\250.py" "b/02_Python\345\210\244\346\226\255\350\257\255\345\217\245/05_if_elif_else\350\257\255\345\217\245\347\232\204\344\275\277\347\224\250.py" index 5215e1f..4b23299 100644 --- "a/02_Python\345\210\244\346\226\255\350\257\255\345\217\245/05_if_elif_else\350\257\255\345\217\245\347\232\204\344\275\277\347\224\250.py" +++ "b/02_Python\345\210\244\346\226\255\350\257\255\345\217\245/05_if_elif_else\350\257\255\345\217\245\347\232\204\344\275\277\347\224\250.py" @@ -12,6 +12,3 @@ elif int(input("请告诉我今天几号:")) == 1: print("今天是1号免费日,可以免费") else: print("不好意思,条件都不满足,需要买票10元。") - - - diff --git "a/03_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" "b/03_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" index 6645468..ab84fcf 100644 --- "a/03_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" +++ "b/03_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" @@ -3,8 +3,10 @@ """ sum = 0 i = 1 +res = [] while i <= 100: sum += i print(i) + res.append(i) i += 1 -print(f"1-100累加的和是:{sum}") +print(f"1-100累加的和是:{str(res)}") diff --git "a/03_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" "b/03_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 77cf1ab..ccdaffe 100644 --- "a/03_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" +++ "b/03_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" @@ -2,12 +2,13 @@ 演示for循环的练习题:数一数有几个a """ # 统计如下字符串中,有多少个字母a -name = "itheima is a brand of itcast" +# name = "itheima is a brand of itcast" +name = [1, 2, 3, 4, 5] # 定义一个变量,用来统计有多少个a count = 0 # for 循环统计 # for 临时变量 in 被统计的数据: for x in name: - if x == "a": + if x == 3: count += 1 print(f"被统计的字符串中有{count}个a") diff --git "a/03_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" "b/03_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" index 3effdd8..d5ad4e3 100644 --- "a/03_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" +++ "b/03_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" @@ -3,8 +3,10 @@ """ name = "itheima" - +# range for x in name: + if x == "i": + print(x) # 将name的内容,挨个取出赋予x临时变量 # 就可以在循环体内对x进行处理 print(x) diff --git "a/03_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_range\350\257\255\345\217\245.py" "b/03_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_range\350\257\255\345\217\245.py" index b8e9ae6..5ef7de6 100644 --- "a/03_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_range\350\257\255\345\217\245.py" +++ "b/03_Python\345\276\252\347\216\257\350\257\255\345\217\245/08_range\350\257\255\345\217\245.py" @@ -12,9 +12,11 @@ # print(x) # range 语法3 range(num1, num2, step) -# for x in range(5, 10, 2): -# # 从5开始,到10结束(不包含10本身)的一个数字序列,数字之间的间隔是2 -# print(x) +for x in range(5, 10, 3): + # 从5开始,到10结束(不包含10本身)的一个数字序列,数字之间的间隔是2 + print(x) -for x in range(10): - print("送玫瑰花") +# for x in range(5): +# print(x) +# if x % 2 == 0: +# print("送玫瑰花") diff --git "a/03_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" "b/03_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" index 5ee68af..fb44590 100644 --- "a/03_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" +++ "b/03_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" @@ -10,14 +10,14 @@ num = random.randint(1, 10) # continue # print("语句2") # 演示continue的嵌套应用 -# for i in range(1, 6): -# print("语句1") -# for j in range(1, 6): -# print("语句2") -# continue -# print("语句3") -# -# print("语句4") +for i in range(1, 6): + print("语句1") + for j in range(1, 6): + print("语句2") + continue + print("语句3") + + print("语句4") # 演示循环中断语句 break # for i in range(1, 101): # print("语句1") -- GitLab