From 8fa1d9dc01079a89020cdca0d5dfbc2606e03915 Mon Sep 17 00:00:00 2001 From: ttyhtg Date: Sun, 20 Dec 2020 15:30:32 +0800 Subject: [PATCH] =?UTF-8?q?4=E7=8F=AD-=E6=AD=A6=E6=98=8E=20-=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E5=91=A8-=E7=AC=AC3=E6=AC=A1=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...43\346\254\241\344\275\234\344\270\232.py" | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 "\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/4\347\217\255/4\347\217\255_\346\255\246\346\230\216/4\347\217\255-\346\255\246\346\230\216-\347\254\254\344\270\200\345\221\250-\347\254\2543\346\254\241\344\275\234\344\270\232.py" diff --git "a/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/4\347\217\255/4\347\217\255_\346\255\246\346\230\216/4\347\217\255-\346\255\246\346\230\216-\347\254\254\344\270\200\345\221\250-\347\254\2543\346\254\241\344\275\234\344\270\232.py" "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/4\347\217\255/4\347\217\255_\346\255\246\346\230\216/4\347\217\255-\346\255\246\346\230\216-\347\254\254\344\270\200\345\221\250-\347\254\2543\346\254\241\344\275\234\344\270\232.py" new file mode 100644 index 00000000..25748f37 --- /dev/null +++ "b/\347\254\254\344\272\214\346\234\237\350\256\255\347\273\203\350\220\245/4\347\217\255/4\347\217\255_\346\255\246\346\230\216/4\347\217\255-\346\255\246\346\230\216-\347\254\254\344\270\200\345\221\250-\347\254\2543\346\254\241\344\275\234\344\270\232.py" @@ -0,0 +1,44 @@ +""" +4班-武明 -第一周-第3次作业提交 +项目 是否可变 是否有序 +列表 可变 有序 +元组 不可变 有序 +字典 可变 无序 +集合 可变 无序 + +""" +# 创建包含6种数据类型的列表 +n = 5 # 整数 +f = 2.8 #浮点数 +s = "chuanchuan" # 字符串 +t = True #布尔值 +no = None # 空值 +b = bytes("hi".encode("utf-8")) # bytes类型 + +# 创建列表list1 +list1 = [n,f,s,t,no,b] + +print("list1 = ",list1,"\nlist1的类型为:",type(list1)) + +print("----------------------------分割线------------------------------------") +# 创建元组tuple1 +tuple1 = (n,f,s,t,no,b) + +print("tuple1 = ",tuple1,"\ntuple1的类型为:",type(tuple1)) + +print("----------------------------分割线------------------------------------") + +# 创建集合set1 +set1 = {n,f,s,t,t,no,b} # 包含所有六种类型 + +print("set1 = ",set1,"\nset1的类型为:",type(set1)) + +print("----------------------------分割线------------------------------------") + +# 创建字典dict +dict1 = {n:2,f:9,s:8,t:5,no:12,b:15} + +print("dict1 = ",dict1,"\ndict1的类型为:",type(dict1), + "\n\n其中n的类型为:",type(5),"\nf的类型为:",type(2.8), + "\ns的类型为:",type(s),"\nt的类型为:",type(t), + "\nno的类型为:",type(no),"\nb的类型为:",type(b)) \ No newline at end of file -- Gitee