摘要: 001、 root@PC1:/home/test# ls test.fastq test.py root@PC1:/home/test# cat test.fastq ## 测试fastq文件 @A00530:26:H35FTDSXX:4:1101:6614:1047 1:N:0:AACGTGAT 阅读全文
posted @ 2022-08-06 22:58 小鲨鱼2018 阅读(583) 评论(0) 推荐(0) 编辑
摘要: 001、创建函数 >>> def test_fun(): ## 创建函数 ... print("hello world!") ... >>> test_fun() ## 调用函数 hello world! 002、顺序参数、关键字参数 >>> def test_fun(x,y): ## 定义函数, 阅读全文
posted @ 2022-08-06 15:05 小鲨鱼2018 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> test1 = dict(c = 200, a = 400, d = 300, b = 700) >>> test1 {'c': 200, 'a': 400, 'd': 300, 'b': 700} >>> test2 = {} >>> temp = [] >>> for i in 阅读全文
posted @ 2022-08-06 14:38 小鲨鱼2018 阅读(51) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> test1 = dict(a = 100, b = 200, c = 300, d = 400) >>> test1 {'a': 100, 'b': 200, 'c': 300, 'd': 400} >>> test2 = dict() >>> for i,j in test1.i 阅读全文
posted @ 2022-08-06 14:34 小鲨鱼2018 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> test1 = ["aaa", "bbb", "ccc", "ddd"] >>> test1 ['aaa', 'bbb', 'ccc', 'ddd'] >>> '_'.join(test1) ## 列表转换为字符串 'aaa_bbb_ccc_ddd' >>> test2 = '_' 阅读全文
posted @ 2022-08-06 14:22 小鲨鱼2018 阅读(64) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> test1 = dict(c = 500, a = 300, b = 200, e = 600, d = 777) >>> test1 {'c': 500, 'a': 300, 'b': 200, 'e': 600, 'd': 777} >>> test2 = dict() >>> 阅读全文
posted @ 2022-08-06 14:18 小鲨鱼2018 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 001、排序 a、 >>> test = [8, 2, 5, 9, 3] >>> test [8, 2, 5, 9, 3] >>> test.sort() ## 直接在原始列表中排序 >>> test [2, 3, 5, 8, 9] >>> test = [8, 2, 5, 9, 3] >>> te 阅读全文
posted @ 2022-08-06 13:19 小鲨鱼2018 阅读(60) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> dict1 = {} >>> dict1 {} >>> dict2 = dict() >>> dict2 {} 002、fromkeys创建 >>> dict1 = {} >>> dict1 {} >>> dict1.fromkeys(['a', 'b', 'c']) ## 值为空 阅读全文
posted @ 2022-08-06 13:05 小鲨鱼2018 阅读(2081) 评论(0) 推荐(0) 编辑
摘要: 001、复制方式1 >>> dict1 = dict(a = 100, b = 200, c = 300, d = 400) >>> dict1 {'a': 100, 'b': 200, 'c': 300, 'd': 400} >>> dict2 = dict1 ## 直接赋值, 原始字典变化,复制 阅读全文
posted @ 2022-08-06 12:56 小鲨鱼2018 阅读(774) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> dict1 = dict(a = 100, b = 200, c = 300, d = 400) >>> dict1 {'a': 100, 'b': 200, 'c': 300, 'd': 400} >>> dict1['e'] = 500 ## 添加元素e >>> dict1 { 阅读全文
posted @ 2022-08-06 12:51 小鲨鱼2018 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 001、del删除 >>> dict1 = dict(a = 100, b = 200, c = 300, d = 400) >>> dict1 {'a': 100, 'b': 200, 'c': 300, 'd': 400} >>> del dict1['b'] ## 删除元素b >>> dict 阅读全文
posted @ 2022-08-06 12:46 小鲨鱼2018 阅读(227) 评论(0) 推荐(0) 编辑