diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 061343bbb136f8fecf456286677455b2e731ea30..eaaa86cf8ae9658b757f6ea600d5f022986d4add 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,28 +4,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -47,54 +51,67 @@
- {
- "keyToString": {
- "Python.01_list列表.executor": "Debug",
- "Python.01_list删除.executor": "Debug",
- "Python.01_while循环练习题_求1-100的和.executor": "Debug",
- "Python.02_list列表的常用操作.executor": "Debug",
- "Python.03_while循环的基础案例-猜数字.executor": "Debug",
- "Python.05_while循环的嵌套案例-九九乘法表.executor": "Debug",
- "Python.05_函数的参数练习案例.executor": "Debug",
- "Python.05_动态参数.executor": "Debug",
- "Python.06_for循环练习题-数一数有几个a.executor": "Debug",
- "Python.06_函数的返回值定义语法.executor": "Debug",
- "Python.07_for循环的基础语法.executor": "Debug",
- "Python.08_range语句.executor": "Debug",
- "Python.09_变量作用域.executor": "Debug",
- "Python.10_for循环打印九九乘法表.executor": "Debug",
- "Python.10_变量的作用域.executor": "Debug",
- "Python.10_局部变量.executor": "Debug",
- "Python.11_局部变量.executor": "Debug",
- "Python.12_二维表格.executor": "Debug",
- "Python.12_循环中断.executor": "Debug",
- "Python.13_全局修改.executor": "Debug",
- "Python.test.executor": "Debug",
- "Python.test_01.executor": "Debug",
- "Python.test_02.executor": "Debug",
- "Python.test_03.executor": "Debug",
- "Python.test_04.executor": "Debug",
- "Python.test_05.executor": "Debug",
- "Python.test_06.executor": "Debug",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "git-widget-placeholder": "main",
- "last_opened_file_path": "/Users/qinyingjie/Documents/python-workspace/python-demo/05_函数进阶",
- "node.js.detected.package.eslint": "true",
- "node.js.detected.package.tslint": "true",
- "node.js.selected.package.eslint": "(autodetect)",
- "node.js.selected.package.tslint": "(autodetect)",
- "nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "configurable.group.appearance",
- "vue.rearranger.settings.migration": "true"
+
+}]]>
+
+
-
-
@@ -104,8 +121,8 @@
-
-
+
+
@@ -114,12 +131,12 @@
-
+
-
+
@@ -128,7 +145,7 @@
-
+
@@ -137,12 +154,12 @@
-
+
-
+
@@ -151,7 +168,7 @@
-
+
@@ -160,12 +177,12 @@
-
+
-
+
@@ -174,7 +191,7 @@
-
+
@@ -183,12 +200,12 @@
-
+
-
+
@@ -197,7 +214,7 @@
-
+
@@ -206,12 +223,12 @@
-
+
-
+
@@ -220,7 +237,7 @@
-
+
@@ -229,12 +246,12 @@
-
+
-
+
@@ -245,11 +262,11 @@
-
-
-
+
+
+
@@ -275,6 +292,9 @@
+
+
+
@@ -340,7 +360,15 @@
1722331876443
-
+
+
+ 1722344289002
+
+
+
+ 1722344289002
+
+
@@ -353,31 +381,37 @@
-
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
-
-
+
-
-
+
\ No newline at end of file
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/01_\345\210\227\350\241\250\345\256\232\344\271\211.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/01_\345\210\227\350\241\250\345\256\232\344\271\211.py"
new file mode 100644
index 0000000000000000000000000000000000000000..955c98d18c670b40d72449f303844e9aedf5f590
--- /dev/null
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/01_\345\210\227\350\241\250\345\256\232\344\271\211.py"
@@ -0,0 +1,20 @@
+"""
+演示数据容器之:list列表
+语法:[元素,元素,....]
+"""
+num = []
+
+# 定义一个列表 list
+my_list = ["itheima", "itcast", 100, 99.9]
+
+print(my_list)
+print(type(my_list))
+
+my_list = ["itheima", 666, True]
+print(my_list)
+print(type(my_list))
+
+# 定义一个嵌套的列表
+my_list = [[1, 2, 3], [4, 5, 6]]
+print(my_list)
+print(type(my_list))
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/02_list\345\210\227\350\241\250\347\232\204\345\270\270\347\224\250\346\223\215\344\275\234.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/02_list\345\210\227\350\241\250\347\232\204\345\270\270\347\224\250\346\223\215\344\275\234.py"
deleted file mode 100644
index a33f9d9615503ed7696f4f7aba1ea7f9919b6190..0000000000000000000000000000000000000000
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/02_list\345\210\227\350\241\250\347\232\204\345\270\270\347\224\250\346\223\215\344\275\234.py"
+++ /dev/null
@@ -1,67 +0,0 @@
-"""
-演示数据容器之:list列表的常用操作
-"""
-mylist = ["itcast", "itheima", "python", "itheima"]
-# 1.1 查找某元素在列表内的下标索引
-index = mylist.index("itheima")
-print(f"itheima在列表中的下标索引值是:{index}")
-# 1.2如果被查找的元素不存在,会报错
-# index = mylist.index("hello")
-# print(f"hello在列表中的下标索引值是:{index}")
-
-# 2. 修改特定下标索引的值
-mylist[0] = "传智教育"
-print(f"列表被修改元素值后,结果是:{mylist}")
-# 3. 在指定下标位置插入新元素
-print("-" * 100)
-mylist.insert(1, "best")
-print(f"列表插入元素后,结果是:{mylist}")
-# 4. 在列表的尾部追加```单个```新元素
-mylist.append("黑马程序员")
-print(f"列表在追加了元素后,结果是:{mylist}")
-# 5. 在列表的尾部追加```一批```新元素
-mylist2 = [1, 2, 3]
-print("-" * 100)
-mylist.append(1)
-mylist.append([1, 2, 3])
-mylist.extend(mylist2)
-print(f"列表在追加了一个新的列表后,结果是:{mylist}")
-# 6. 删除指定下标索引的元素(2种方式)
-mylist = ["itcast", "itheima", "python"]
-
-# 6.1 方式1:del 列表[下标]
-del mylist[2]
-print(f"列表删除元素后结果是:{mylist}")
-# 6.2 方式2:列表.pop(下标)
-mylist = ["itcast", "itheima", "python"]
-element = mylist.pop(2)
-print(f"通过pop方法取出元素后列表内容:{mylist}, 取出的元素是:{element}")
-# 7. 删除某元素在列表中的第一个匹配项
-mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
-mylist.remove("itheima")
-# mylist.remove("2")
-print(f"通过remove方法移除元素后,列表的结果是:{mylist}")
-
-# 8. 清空列表
-mylist.clear()
-print(f"列表被清空了,结果是:{mylist}")
-# 9. 统计列表内某元素的数量
-mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
-count = mylist.count("itheima")
-count = mylist.count("itcast")
-print(f"列表中itheima的数量是:{count}")
-
-# 10. 统计列表中全部的元素数量
-mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
-count = len(mylist)
-print(f"列表的元素数量总共有:{count}个")
-
-# 7. 删除某元素在列表中的第一个匹配项
-mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
-mylist.reverse()
-print(f"通过reverse方法翻转后,列表的结果是:{mylist}")
-
-# 7. 删除某元素在列表中的第一个匹配项
-mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
-mylist.remove("itheima")
-print(f"通过remove方法移除元素后,列表的结果是:{mylist}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/01_list\345\210\227\350\241\250.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/02_\345\210\227\350\241\250\347\232\204\345\217\226\345\200\274.py"
similarity index 67%
rename from "06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/01_list\345\210\227\350\241\250.py"
rename to "06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/02_\345\210\227\350\241\250\347\232\204\345\217\226\345\200\274.py"
index 0d8c53465b1207564a4ab7d7f1c591d51b566f64..0a70c835f460072567aa561e7c710cf969988ae3 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/01_list\345\210\227\350\241\250.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/02_\345\210\227\350\241\250\347\232\204\345\217\226\345\200\274.py"
@@ -2,22 +2,6 @@
演示数据容器之:list列表
语法:[元素,元素,....]
"""
-num = []
-
-# 定义一个列表 list
-my_list = ["itheima", "itcast", 100, 99.9]
-
-print(my_list)
-print(type(my_list))
-
-my_list = ["itheima", 666, True]
-print(my_list)
-print(type(my_list))
-
-# 定义一个嵌套的列表
-my_list = [[1, 2, 3], [4, 5, 6]]
-print(my_list)
-print(type(my_list))
# 通过下标索引取出对应位置的数据
my_list = ["Tom", "Lily", "Rose"]
@@ -27,7 +11,7 @@ print(my_list[1])
print(my_list[2])
# 错误示范;通过下标索引取数据,一定不要超出范围
# print(my_list[3])
-print('1111' * 100)
+print('1' * 100)
# 通过下标索引取出数据(倒序取出)
print(my_list[len(my_list) - 1])
print('-' * 100)
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/03_list\345\210\227\350\241\250\345\270\270\347\224\250\346\223\215\344\275\234\350\257\276\345\220\216\347\273\203\344\271\240.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/03_list\345\210\227\350\241\250\345\270\270\347\224\250\346\223\215\344\275\234\350\257\276\345\220\216\347\273\203\344\271\240.py"
deleted file mode 100644
index 4b2b67a1d8893efb6020402e960559381bc75244..0000000000000000000000000000000000000000
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/03_list\345\210\227\350\241\250\345\270\270\347\224\250\346\223\215\344\275\234\350\257\276\345\220\216\347\273\203\344\271\240.py"
+++ /dev/null
@@ -1,24 +0,0 @@
-"""
-演示List常用操作的课后练习
-"""
-
-# 1. 定义这个列表,并用变量接收它, 内容是:[21, 25, 21, 23, 22, 20]
-mylist = [21, 25, 21, 23, 22, 20]
-
-# 2. 追加一个数字31,到列表的尾部
-mylist.append(31)
-
-# 3. 追加一个新列表[29, 33, 30],到列表的尾部
-mylist.extend([29, 33, 30])
-# 4. 取出第一个元素(应是:21)
-num1 = mylist[0]
-print(f"从列表中取出来第一个元素,应该是21,实际上是:{num1}")
-
-# 5. 取出最后一个元素(应是:30)
-num2 = mylist[-1]
-print(f"从列表中取出来最后一个元素,应该是30,实际上是:{num2}")
-
-# 6. 查找元素31,在列表中的下标位置
-index = mylist.index(31)
-print(f"元素31在列表的下标位置是:{index}")
-print(f"最后列表的内容是:{mylist}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/02_list\345\210\240\351\231\244.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/03_\345\210\227\350\241\250\345\210\240\351\231\244.py"
similarity index 100%
rename from "06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/02_list\345\210\240\351\231\244.py"
rename to "06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/03_\345\210\227\350\241\250\345\210\240\351\231\244.py"
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/04_\345\200\274\347\232\204\347\264\242\345\274\225.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/04_\345\200\274\347\232\204\347\264\242\345\274\225.py"
new file mode 100644
index 0000000000000000000000000000000000000000..85538ac3bee777a1eb3bf7921b520a697898fdea
--- /dev/null
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/04_\345\200\274\347\232\204\347\264\242\345\274\225.py"
@@ -0,0 +1,7 @@
+mylist = ["itcast", "itheima", "python", "itheima"]
+# 1.1 查找某元素在列表内的下标索引
+index = mylist.index("itheima")
+print(f"itheima在列表中的下标索引值是:{index}")
+# 1.2如果被查找的元素不存在,会报错
+# index = mylist.index("hello")
+# print(f"hello在列表中的下标索引值是:{index}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/05_\344\277\256\346\224\271\345\210\227\350\241\250\345\200\274.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/05_\344\277\256\346\224\271\345\210\227\350\241\250\345\200\274.py"
new file mode 100644
index 0000000000000000000000000000000000000000..c081a23b71824bc88e293691605a070dbab6d383
--- /dev/null
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/05_\344\277\256\346\224\271\345\210\227\350\241\250\345\200\274.py"
@@ -0,0 +1,4 @@
+mylist = ["itcast", "itheima", "python", "itheima"]
+# 2. 修改特定下标索引的值
+mylist[0] = "传智教育"
+print(f"列表被修改元素值后,结果是:{mylist}")
\ No newline at end of file
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/06_\345\210\227\350\241\250\346\226\260\345\242\236.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/06_\345\210\227\350\241\250\346\226\260\345\242\236.py"
new file mode 100644
index 0000000000000000000000000000000000000000..1bb76cbdf29072c03306a908a3b2c7768e7a8669
--- /dev/null
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/06_\345\210\227\350\241\250\346\226\260\345\242\236.py"
@@ -0,0 +1,17 @@
+mylist = ["itcast", "itheima", "python", "itheima"]
+# 3. 在指定下标位置插入新元素
+print("-" * 100)
+mylist.insert(1, "best")
+print(f"列表插入元素后,结果是:{mylist}")
+# 4. 在列表的尾部追加```单个```新元素
+mylist.append("黑马程序员")
+print(f"列表在追加了元素后,结果是:{mylist}")
+# 5. 在列表的尾部追加```一批```新元素
+mylist2 = [1, 2, 3]
+print("-" * 100)
+mylist.append(1)
+mylist.append([1, 2, 3])
+mylist.extend(mylist2)
+print(f"列表在追加了一个新的列表后,结果是:{mylist}")
+# 6. 删除指定下标索引的元素(2种方式)
+mylist = ["itcast", "itheima", "python"]
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/07_\345\210\227\350\241\250\345\210\240\351\231\244.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/07_\345\210\227\350\241\250\345\210\240\351\231\244.py"
new file mode 100644
index 0000000000000000000000000000000000000000..babb1345014a10d74dad66c95660b2c28b306a2d
--- /dev/null
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/07_\345\210\227\350\241\250\345\210\240\351\231\244.py"
@@ -0,0 +1,17 @@
+mylist = ["itcast", "itheima", "python", "itheima"]
+# 6.1 方式1:del 列表[下标]
+del mylist[2]
+print(f"列表删除元素后结果是:{mylist}")
+# 6.2 方式2:列表.pop(下标)
+mylist = ["itcast", "itheima", "python"]
+element = mylist.pop(2)
+print(f"通过pop方法取出元素后列表内容:{mylist}, 取出的元素是:{element}")
+# 7. 删除某元素在列表中的第一个匹配项
+mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
+mylist.remove("itheima")
+# mylist.remove("2")
+print(f"通过remove方法移除元素后,列表的结果是:{mylist}")
+
+# 8. 清空列表
+mylist.clear()
+print(f"列表被清空了,结果是:{mylist}")
\ No newline at end of file
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/08_\345\210\227\350\241\250\351\225\277\345\272\246.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/08_\345\210\227\350\241\250\351\225\277\345\272\246.py"
new file mode 100644
index 0000000000000000000000000000000000000000..eeae0b493328b3df99bca27312c69fe81eb4c328
--- /dev/null
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/08_\345\210\227\350\241\250\351\225\277\345\272\246.py"
@@ -0,0 +1,9 @@
+# 9. 统计列表内某元素的数量
+mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
+count = mylist.count("itheima")
+print(f"列表中itheima的数量是:{count}")
+
+# 10. 统计列表中全部的元素数量
+mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
+count = len(mylist)
+print(f"列表的元素数量总共有:{count}个")
\ No newline at end of file
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/09_\345\210\227\350\241\250\345\217\215\350\275\254.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/09_\345\210\227\350\241\250\345\217\215\350\275\254.py"
new file mode 100644
index 0000000000000000000000000000000000000000..64d1b176552df9c7d5bc5031e04328bbe39b197c
--- /dev/null
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/09_\345\210\227\350\241\250\345\217\215\350\275\254.py"
@@ -0,0 +1,3 @@
+mylist = ["itcast", "itheima", "itcast", "itheima", "python"]
+mylist.reverse()
+print(f"通过reverse方法翻转后,列表的结果是:{mylist}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/05_list\345\210\227\350\241\250\347\232\204\345\276\252\347\216\257.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/10_\345\210\227\350\241\250\351\201\215\345\216\206.py"
similarity index 100%
rename from "06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/05_list\345\210\227\350\241\250\347\232\204\345\276\252\347\216\257.py"
rename to "06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/10_\345\210\227\350\241\250\351\201\215\345\216\206.py"
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test.py"
deleted file mode 100644
index 7e82ef2e28e5eaf40ed0d5797ca55508a11607d7..0000000000000000000000000000000000000000
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test.py"
+++ /dev/null
@@ -1,9 +0,0 @@
-my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-new_list = []
-i = 0
-while i < len(my_list):
- if my_list[i] % 2 == 0:
- new_list.append(my_list[i])
- i += 1
-
-print(f"偶数形成的新列表:{new_list}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test_01.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test_01.py"
deleted file mode 100644
index 5ddfce94a5200bce15557a61b269feacd0a92ff2..0000000000000000000000000000000000000000
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test_01.py"
+++ /dev/null
@@ -1,3 +0,0 @@
-mylist = ["传智教育", "黑马程序员", "Python"]
-for e in mylist:
- print(e)
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test_02.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test_02.py"
deleted file mode 100644
index c16e91b8f4eb802f262b93c9b5a2450d4a5823bf..0000000000000000000000000000000000000000
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/01-\345\210\227\350\241\250/test_02.py"
+++ /dev/null
@@ -1,8 +0,0 @@
-mylist = ["传智教育", "黑马程序员", "Python"]
-
-# 列推导式
-mylist = [e + "ABC" for e in mylist]
-print(mylist)
-
-for e in mylist:
- print(e + 'abc')
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/06_\345\255\227\347\254\246\344\270\262.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/06_\345\255\227\347\254\246\344\270\262.py"
similarity index 68%
rename from "06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/06_\345\255\227\347\254\246\344\270\262.py"
rename to "06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/06_\345\255\227\347\254\246\344\270\262.py"
index 18aa00afa4addabc9113036f5720d20e4a594e5c..7eb63e7cbd2f4c5d9b1f831291deec1d873b6e31 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/06_\345\255\227\347\254\246\344\270\262.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/06_\345\255\227\347\254\246\344\270\262.py"
@@ -1,12 +1,24 @@
"""
演示以数据容器的角色,学习字符串的相关操作
"""
+ddd = '散发斯蒂芬'
+''
+""
+sql = """
+select * from table
+"""
+f"是打发斯蒂芬{ddd}"
+type(sql)
+
my_str = "itheima and itcast"
+
# 通过下标索引取值
value = my_str[2]
value2 = my_str[-16]
+# value3 = my_str[-160]
print(f"从字符串{my_str}取下标为2的元素,。值是:{value},取下标为-16的元素。值是:{value2}")
+# 字符串对象不支持赋值
# my_str[2] = "H"
# index方法
@@ -14,21 +26,29 @@ value = my_str.index("and")
print(f"在字符串{my_str}中查找and,其起始下标是:{value}")
# replace方法
-new_my_str = my_str.replace("it", "程序")
+print("++" * 100)
+# new_my_str = my_str.replace("it", "程序")
+new_my_str = my_str.replace("it", "程序", 2)
print(f"将字符串{my_str},进行替换后得到:{new_my_str}")
# split方法
my_str = "hello python itheima itcast"
-my_str_list = my_str.split(" ")
+my_str_list = my_str.split("it")
+print("-" * 100)
print(f"将字符串{my_str}进行split切分后得到:{my_str_list}, 类型是:{type(my_str_list)}")
# strip方法
my_str = " itheima and itcast "
-new_my_str = my_str.strip() # 不传入参数,去除首尾空格
+new_my_str = my_str.strip() # 不传入参数,去除首尾空格
print(f"字符串{my_str}被strip后,结果:{new_my_str}")
+# my_str.rstrip()
+# my_str.lstrip()
-my_str = "12itheima and itcast21"
+# 回文数 123456654321
+my_str = "12itheima and itcast12"
+# new_my_str = my_str.strip("12")
new_my_str = my_str.strip("12")
+print("-" * 100)
print(f"字符串{my_str}被strip('12')后,结果:{new_my_str}")
# 统计字符串中某字符串的出现次数, count
@@ -39,7 +59,9 @@ print(f"字符串{my_str}中it出现的次数是:{count}")
num = len(my_str)
print(f"字符串{my_str}的长度是:{num}")
-
my_str = "12itheima and itcast21"
new_my_str = my_str.strip("231")
-print(f"字符串{my_str}被strip('12')后,结果:{new_my_str}")
\ No newline at end of file
+print(f"字符串{my_str}被strip('12')后,结果:{new_my_str}")
+
+url = ' http://www.baidu.com '
+print(url.strip())
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/07_\345\255\227\347\254\246\344\270\262\350\257\276\345\220\216\347\273\203\344\271\240.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/07_\345\255\227\347\254\246\344\270\262\350\257\276\345\220\216\347\273\203\344\271\240.py"
similarity index 94%
rename from "06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/07_\345\255\227\347\254\246\344\270\262\350\257\276\345\220\216\347\273\203\344\271\240.py"
rename to "06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/07_\345\255\227\347\254\246\344\270\262\350\257\276\345\220\216\347\273\203\344\271\240.py"
index c7143faef0e917fc73e275c74a0f9f7ff876e19f..ba0bc21e865ae55524610a55673fb873dd220b6d 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/07_\345\255\227\347\254\246\344\270\262\350\257\276\345\220\216\347\273\203\344\271\240.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/07_\345\255\227\347\254\246\344\270\262\350\257\276\345\220\216\347\273\203\344\271\240.py"
@@ -2,6 +2,7 @@
字符串课后练习演示
"itheima itcast boxuegu"
"""
+[1, 2, 3, 4, 5, 6, 7] # 列表
my_str = "itheima itcast boxuegu"
# 统计字符串内有多少个"it"字符
num = my_str.count("it")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/16_\345\255\227\347\254\246\344\270\262\345\244\247\345\260\217\346\257\224\350\276\203.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/16_\345\255\227\347\254\246\344\270\262\345\244\247\345\260\217\346\257\224\350\276\203.py"
similarity index 92%
rename from "06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/16_\345\255\227\347\254\246\344\270\262\345\244\247\345\260\217\346\257\224\350\276\203.py"
rename to "06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/16_\345\255\227\347\254\246\344\270\262\345\244\247\345\260\217\346\257\224\350\276\203.py"
index fcd1c623eb930bbc4ffb2c8dc5647f6817bc7ae2..475693786d19db75472fd0a148dbab944858a5f0 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\255\227\347\254\246\344\270\262/16_\345\255\227\347\254\246\344\270\262\345\244\247\345\260\217\346\257\224\350\276\203.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\255\227\347\254\246\344\270\262/16_\345\255\227\347\254\246\344\270\262\345\244\247\345\260\217\346\257\224\350\276\203.py"
@@ -2,7 +2,10 @@
演示字符串大小比较
"""
+# 11.9 和 11.11
+
# abc 比较 abd
+# a z
print(f"abd大于abc,结果:{'abd' > 'abc'}")
# a 比较 ab
print(f"ab大于a,结果:{'ab' > 'a'}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\205\203\347\273\204/05_tuple\345\205\203\347\273\204.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\205\203\347\273\204/05_tuple\345\205\203\347\273\204.py"
similarity index 79%
rename from "06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\205\203\347\273\204/05_tuple\345\205\203\347\273\204.py"
rename to "06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\205\203\347\273\204/05_tuple\345\205\203\347\273\204.py"
index 799da0c9aedb047c4a5c85c684512a44545ebc58..9f14b93b305938fac0645ba02ecf6bbc5ae69786 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/02-\345\205\203\347\273\204/05_tuple\345\205\203\347\273\204.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/03-\345\205\203\347\273\204/05_tuple\345\205\203\347\273\204.py"
@@ -1,24 +1,37 @@
"""
演示tuple元组的定义和操作
"""
+da = 1, 23,
+print(f"da的类型是:{type(da)}")
-# 定义元组
+(1, 2, 3, 4)
+# 定义元组 不可变
t1 = (1, "Hello", True)
-t2 = ()
+t2 = (1, 2, 3)
+t1.__add__(t2)
+print(f"t1 = {t1}")
+
+print(t1)
t3 = tuple()
print(f"t1的类型是:{type(t1)}, 内容是:{t1}")
print(f"t2的类型是:{type(t2)}, 内容是:{t2}")
print(f"t3的类型是:{type(t3)}, 内容是:{t3}")
-
+type(list(t1))
# 定义单个元素的元素
-t4 = ("hello", )
+print("-" * 100)
+# 元组不能只有一个
+t4 = ('111,',)
+t5 = (1 + 2)
+print(len(t4))
+
print(f"t4的类型是:{type(t4)}, t4的内容是:{t4}")
+print(f"t5的类型是:{type(t5)}, tt5的内容是:{t5}")
# 元组的嵌套
-t5 = ( (1, 2, 3), (4, 5, 6) )
+t5 = ((1, 2, 3), (4, 5, 6))
print(f"t5的类型是:{type(t5)}, 内容是:{t5}")
-
+print("-"*100)
# 下标索引去取出内容
-num = t5[1][2]
+num = t5[0][2]
print(f"从嵌套元组中取出的数据是:{num}")
# 元组的操作:index查找方法
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/10_\351\233\206\345\220\210.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/10_\351\233\206\345\220\210.py"
index c92a0afd7aec93165737d877928776d8a88a9f43..152ae80e08b824769114eb2a2641fca05b51a367 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/10_\351\233\206\345\220\210.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/10_\351\233\206\345\220\210.py"
@@ -1,16 +1,25 @@
"""
演示数据容器集合的使用
"""
+# 定义集合 不重复
+set()
-# 定义集合
+res = {'2', '2', '额我认为二'} # 集合
+print(res)
+
+['2', '2', '额我认为二'] # 列表
my_set = {"传智教育", "黑马程序员", "itheima", "传智教育", "黑马程序员", "itheima", "传智教育", "黑马程序员", "itheima"}
+
my_set_empty = set() # 定义空集合
+my_set_empty.add(1111)
+
print(f"my_set的内容是:{my_set}, 类型是:{type(my_set)}")
print(f"my_set_empty的内容是:{my_set_empty}, 类型是:{type(my_set_empty)}")
# 添加新元素
my_set.add("Python")
-my_set.add("传智教育") #
+my_set.add("传智教育")
+my_set.add("传智教育")
print(f"my_set添加元素后结果是:{my_set}")
# 移除元素
my_set.remove("黑马程序员")
@@ -18,6 +27,9 @@ print(f"my_set移除黑马程序员后,结果是:{my_set}")
# 随机取出一个元素
my_set = {"传智教育", "黑马程序员", "itheima"}
element = my_set.pop()
+# element = my_set.pop("传智教育")
+# element = my_set.pop(1)
+print("-"*100)
print(f"集合被取出元素是:{element}, 取出元素后:{my_set}")
# 清空集合, clear
@@ -28,6 +40,7 @@ print(f"集合被清空啦,结果是:{my_set}")
set1 = {1, 2, 3}
set2 = {1, 5, 6}
set3 = set1.difference(set2)
+print("-"*100)
print(f"取出差集后的结果是:{set3}")
print(f"取差集后,原有set1的内容:{set1}")
print(f"取差集后,原有set2的内容:{set2}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/11_\351\233\206\345\220\210\350\257\276\345\220\216\347\273\203\344\271\240.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/11_\351\233\206\345\220\210\350\257\276\345\220\216\347\273\203\344\271\240.py"
index 7224efb39d35c4843141643192c857640d52af91..3a96d6fc64bd805ce450a13ee1f495e9cd129bf5 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/11_\351\233\206\345\220\210\350\257\276\345\220\216\347\273\203\344\271\240.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/11_\351\233\206\345\220\210\350\257\276\345\220\216\347\273\203\344\271\240.py"
@@ -3,17 +3,19 @@
my_list = ['黑马程序员', '传智播客', '黑马程序员', '传智播客',
'itheima', 'itcast', 'itheima', 'itcast', 'best']
"""
-my_list = ['黑马程序员', '传智播客', '黑马程序员', '传智播客',
- 'itheima', 'itcast', 'itheima', 'itcast', 'best']
+my_list = {'黑马程序员', '传智播客', '黑马程序员', '传智播客',
+ 'itheima', 'itcast', 'itheima', 'itcast', 'best'}
# 定义一个空集合
-my_set = set()
+# my_set = {1, 2, 3}
+# set转list
+print(list(my_list))
-# 通过for循环遍历列表
-for element in my_list:
- # 在for循环中将列表的元素添加至集合
- my_set.add(element)
+# # 通过for循环遍历列表
+# for element in my_list:
+# # 在for循环中将列表的元素添加至集合
+# my_set.add(element)
# 最终得到元素去重后的集合对象,并打印输出
-print(f"列表的内容是:{my_list}")
-print(f"通过for循环后,得到的集合对象是:{my_set}")
+# print(f"列表的内容是:{my_list}")
+# print(f"通过for循环后,得到的集合对象是:{my_set}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/12_\351\233\206\345\220\210\350\257\276\345\220\216\347\273\203\344\271\240.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/12_\351\233\206\345\220\210\350\257\276\345\220\216\347\273\203\344\271\240.py"
new file mode 100644
index 0000000000000000000000000000000000000000..156ec373fa116357349c42e7634f85f70e8c58fb
--- /dev/null
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/04-\351\233\206\345\220\210/12_\351\233\206\345\220\210\350\257\276\345\220\216\347\273\203\344\271\240.py"
@@ -0,0 +1,20 @@
+"""
+演示集合的课后练习题
+my_list = ['黑马程序员', '传智播客', '黑马程序员', '传智播客',
+ 'itheima', 'itcast', 'itheima', 'itcast', 'best']
+"""
+my_list = ['黑马程序员', '传智播客', '黑马程序员', '传智播客',
+ 'itheima', 'itcast', 'itheima', 'itcast', 'best']
+# 定义一个空集合
+# my_set = {1, 2, 3}
+# set转list
+# res = set(my_list)
+print(tuple(my_list))
+# # 通过for循环遍历列表
+# for element in my_list:
+# # 在for循环中将列表的元素添加至集合
+# my_set.add(element)
+
+# 最终得到元素去重后的集合对象,并打印输出
+# print(f"列表的内容是:{my_list}")
+# print(f"通过for循环后,得到的集合对象是:{my_set}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/05-\345\255\227\345\205\270/12_\345\255\227\345\205\270.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/05-\345\255\227\345\205\270/12_\345\255\227\345\205\270.py"
index 5ce537c8a836d954518b9bd4f8d3bf561e6681b7..1fdfce421e286e41667006ebf3359a49d3204263 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/05-\345\255\227\345\205\270/12_\345\255\227\345\205\270.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/05-\345\255\227\345\205\270/12_\345\255\227\345\205\270.py"
@@ -2,8 +2,8 @@
演示数据容器字典的定义
"""
-# 定义字典
-my_dict1 = {"王力鸿": 99, "周杰轮": 88, "林俊节": 77}
+# 定义字典 键值对 key value
+my_dict1 = {"王力鸿": '多翻翻', "周杰轮": 88, "林俊节": 77}
# 定义空字典
my_dict2 = {}
my_dict3 = dict()
@@ -16,8 +16,11 @@ my_dict1 = {"王力鸿": 99, "王力鸿": 88, "林俊节": 77}
print(f"重复key的字典的内容是:{my_dict1}")
# 从字典中基于Key获取Value
-my_dict1 = {"王力鸿": 99, "周杰轮": 88, "林俊节": 77}
+print("-" * 100)
+my_dict1 = {"王力鸿": 99, "王力鸿": 11, "周杰轮": 88, "林俊节": 77}
+print(my_dict1)
score = my_dict1["王力鸿"]
+
print(f"王力鸿的考试分数是:{score}")
score = my_dict1["周杰轮"]
print(f"周杰轮的考试分数是:{score}")
diff --git "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/05-\345\255\227\345\205\270/13_\345\255\227\345\205\270\347\232\204\345\270\270\347\224\250\346\223\215\344\275\234.py" "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/05-\345\255\227\345\205\270/13_\345\255\227\345\205\270\347\232\204\345\270\270\347\224\250\346\223\215\344\275\234.py"
index 840215cacb0db3bc8129d7d62558bf1559dbe749..bea0699f4d7fda53e46d1151d07092fa2519d964 100644
--- "a/06_\346\225\260\346\215\256\345\256\271\345\231\250/05-\345\255\227\345\205\270/13_\345\255\227\345\205\270\347\232\204\345\270\270\347\224\250\346\223\215\344\275\234.py"
+++ "b/06_\346\225\260\346\215\256\345\256\271\345\231\250/05-\345\255\227\345\205\270/13_\345\255\227\345\205\270\347\232\204\345\270\270\347\224\250\346\223\215\344\275\234.py"
@@ -19,7 +19,9 @@ print(f"字典被清空了,内容是:{my_dict}")
# 获取全部的key
my_dict = {"周杰轮": 99, "林俊节": 88, "张学油": 77}
keys = my_dict.keys()
-print(f"字典的全部keys是:{keys}")
+print("-" * 100)
+#
+print(f"字典的全部keys是:{keys} {type(keys)}")
# 遍历字典
# 方式1:通过获取到全部的key来完成遍历
for key in keys:
@@ -31,6 +33,18 @@ for key in my_dict:
print(f"2字典的key是:{key}")
print(f"2字典的value是:{my_dict[key]}")
+print("-" * 100)
+
+my_dict.values()
+for key in my_dict:
+ print(type(key))
+ # my_dict.
+ print(f"2字典的key是:{key}")
+ # print(f"2字典的key是:{value}")
+
+for item in my_dict.items():
+ print(item[0], item[1])
+
# 统计字典内的元素数量, len()函数
num = len(my_dict)
print(f"字典中的元素数量有:{num}个")