摘要: #include <stdio.h>:定义输入/输出函数 #include <stdlib.h>:定义杂项函数及内存分配函数 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main() 5 { 6 printf("hello world!\n\ 阅读全文
posted @ 2018-08-22 11:48 archerzon 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 集合: 1 list_1 = [1,2,3,3] 2 list_1 = set(list_1)#集合的用法 3 print(list_1,type(list_1)) 4 5 6 list_2 = set([3,4,5]) 7 print(list_1,list_2) 交集和交集运算符: 1 list 阅读全文
posted @ 2018-08-20 14:08 archerzon 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 在退出系统,打印购物清单后,wait 2s再退出 1 #Author:Archer Zon 2 import time 3 product_list = [ 4 ('iPhone X', 5800), 5 ('Mac Pro', 10800), 6 ('Bike', 800), 7 ('Coffe' 阅读全文
posted @ 2018-08-20 13:24 archerzon 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 加入time模块,在退出系统前等待2s 1 import time 2 product_list = [ 3 ('iphone',5800), 4 ('Mac Pro', 10800), 5 ('Bike', 800), 6 ('Coffee', 31), 7 ('iWatch', 6800), 8 阅读全文
posted @ 2018-08-18 15:46 archerzon 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 字符串不能修改,对字符串进行大小写其实质是将原来的字符串覆盖 列表可以增删改查,通过下标来查找 元组是只读列表 字典是无序的,通过key来查找,不通过下标 集合是无序的 阅读全文
posted @ 2018-08-17 17:11 archerzon 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 原理:字典,字典里嵌套字典,while循环嵌套的重复使用,标志位exit_flag的使用,pass的使用(什么都不做,使系统不报错) 1 #Author:Archer Zon 2 data = { 3 '北京':{ 4 "昌平":{ 5 "天河":{1111,"2323fdf"} 6 }, 7 "朝 阅读全文
posted @ 2018-08-16 20:26 archerzon 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 字典的格式: 1 info = { 2 'stu001' : "Archer", 3 'stu002' : "Berserker", 4 'stu003' : "Caster", 5 } 6 print(info) 查: 1 info ={ 2 'stu001' : "Archer", 3 'stu 阅读全文
posted @ 2018-08-16 16:39 archerzon 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 原理:列表,元组,while循环,isdigit,for循环,enumerate用法,if语句的套用, 1 #Author:Archer Zon 2 product_list = [ 3 ('iphone', 5800), 4 ('Mac Pro', 10800), 5 ('Bike', 800), 阅读全文
posted @ 2018-08-16 12:31 archerzon 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 元组只能count和index,元组的结构为小括号(),且元组的值不能修改,也叫只读列表。元组可以提醒别人这个值不能修改。 names = ('alex','jack') 阅读全文
posted @ 2018-08-15 17:09 archerzon 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 1 name = ["a","b",["alex","blue"],"c","d"] 2 print(name[0:-1:2]) 3 print(name[::2])#0和-1可以省略 4 print(name[:])#全部打印 阅读全文
posted @ 2018-08-15 16:11 archerzon 阅读(570) 评论(0) 推荐(0) 编辑