摘要: 001、 >>> [[0] * 5 for i in range(3)] ## 生成3行5列,元素为0的矩阵 [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]] 002、 >>> [ [1, 2, 3] * 2 for i in range(6)] 阅读全文
posted @ 2022-08-20 01:38 小鲨鱼2018 阅读(292) 评论(0) 推荐(0) 编辑
摘要: pyhton 中内置函数enumerate用于将序列生成二元组。 001、 >>> str1 = "hello!" ## 测试字符串 >>> for i in enumerate(str1): ## enumerate用于将序列生成二元组 ... print(i) ... (0, 'h') (1, 阅读全文
posted @ 2022-08-20 01:18 小鲨鱼2018 阅读(37) 评论(0) 推荐(0) 编辑
摘要: 001、 >>> test1 = [] >>> test1 [] >>> if not test1: ## 判断列表为空 ... print("no element") ... no element 002、 >>> test1 = () >>> test1 () >>> if not test1: 阅读全文
posted @ 2022-08-20 01:05 小鲨鱼2018 阅读(521) 评论(0) 推荐(0) 编辑
摘要: 001、读取fasta文件 root@PC1:/home/test# ls a.fasta root@PC1:/home/test# cat a.fasta ## 测试数据 >Rosalind_1 ATCCAGCT >Rosalind_2 GGGCAACT >Rosalind_3 ATGGATCT 阅读全文
posted @ 2022-08-20 00:38 小鲨鱼2018 阅读(175) 评论(0) 推荐(0) 编辑