摘要:
1、基本用法 >>> test1 = ["aa","bb","cc","dd","ee","ff"] >>> type(test1) <class 'list'> >>> len(test1) 6 >>> test1[0:3] ## 不包含索引为3的元素 ['aa', 'bb', 'cc'] >>> 阅读全文
posted @ 2020-12-18 20:58
小鲨鱼2018
阅读(511)
评论(0)
推荐(0)
摘要:
1、循环 >>> test1 = ["aa","bb","cc","dd","ee","ff","gg"] >>> test1 ['aa', 'bb', 'cc', 'dd', 'ee', 'ff', 'gg'] >>> test2 = [] >>> test2 [] > 阅读全文
posted @ 2020-12-18 20:40
小鲨鱼2018
阅读(1009)
评论(0)
推荐(0)
摘要:
1、for循环 >>> test1 = ["aa","bb","cc","dd","ee","ff","gg","hh","ii","jj","kk","ll","mm","nn"] >>> type(test1) <class 'list'> >& 阅读全文
posted @ 2020-12-18 20:14
小鲨鱼2018
阅读(2442)
评论(0)
推荐(0)
摘要:
>>> test = ["aaa","bbb","ccc","ddd"] >>> type(test) <class 'list'> >>> len(test) 4 >>> test.pop() ## pop弹出 'ddd' >>> test ['aaa', 'bbb', 'ccc'] >>> te 阅读全文
posted @ 2020-12-18 19:51
小鲨鱼2018
阅读(137)
评论(0)
推荐(0)
摘要:
>>> prizes = ["aaa","bbb","ccc","ddd","eee"] >>> import random >>> for i in range(1,11,1): ## 设计抽十次 print(f"The {i}th prize is {random.choice(prizes)} 阅读全文
posted @ 2020-12-18 19:34
小鲨鱼2018
阅读(294)
评论(0)
推荐(0)
摘要:
>>> range(10) range(0, 10) >>> list(range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> list(range(0,10,2)) [0, 2, 4, 6, 8] >>> list(range(0,10,3)) [0, 3, 6 阅读全文
posted @ 2020-12-18 19:09
小鲨鱼2018
阅读(1024)
评论(0)
推荐(0)
摘要:
>>> test1 = ["aaa","bbb","ccc","ddd"] >>> type(test1) <class 'list'> >>> len(test1) 4 >>> test1[0] ## 查看第一个元素 'aaa' >>> test1[2] 'ccc' >>> test1[-1] # 阅读全文
posted @ 2020-12-18 18:39
小鲨鱼2018
阅读(3308)
评论(0)
推荐(0)
摘要:
>>> test1 = ["aaa","bbb","ccc"] >>> type(test1) <class 'list'> >>> len(test1) 3 >>> test1.append("xxx") ## 追加 >>> test1 ['aaa', 'bbb', 'ccc', 'xxx'] > 阅读全文
posted @ 2020-12-18 18:34
小鲨鱼2018
阅读(6532)
评论(0)
推荐(0)
摘要:
以下实验使用三台虚拟机完成。 服务器端:PC1,192.168.10.10 客户机端:PC2,192.168.10.20 客户机端:PC3,192.168.10.30 1、PC1服务器端安装apache服务 [root@PC1 ~]# yum install httpd -y Loaded plug 阅读全文
posted @ 2020-12-18 00:49
小鲨鱼2018
阅读(893)
评论(0)
推荐(0)