上一页 1 ··· 185 186 187 188 189 190 191 192 193 ··· 403 下一页
摘要: 001、 >>> str1 = "xabdxyabxykk" ## 测试字符串 >>> str1 'xabdxyabxykk' >>> str1.find("ab") ## 返回测试字符串中首次匹配ab的首字符的索引 1 >>> str1.find("ab", 3) ## 指定在字符串中匹配的起始位 阅读全文
posted @ 2022-08-14 17:02 小鲨鱼2018 阅读(82) 评论(0) 推荐(0)
摘要: 文章来源:https://www.jianshu.com/p/2475c3240a67 简化的短序列匹配程序 (map.py) 把short.fa中的序列比对到ref.fa, 输出短序列匹配到ref.fa文件中哪些序列的哪些位置。 f1 = r'E:\Bioinformatics\Python\pr 阅读全文
posted @ 2022-08-14 16:54 小鲨鱼2018 阅读(99) 评论(0) 推荐(0)
摘要: 001、 >>> test1 = "100 200" ## test1为字符串 >>> test1 '100 200' >>> a,b = test1.split() ## 拆分字符串,直接赋值给变量名 >>> a '100' >>> b '200' >>> test2 = [500, 1000] 阅读全文
posted @ 2022-08-14 16:32 小鲨鱼2018 阅读(486) 评论(0) 推荐(0)
摘要: 001、 方法1 root@PC1:/home/test3# ls a.txt test.py root@PC1:/home/test3# cat a.txt ## 测试文件 ACTGCCCTAAGTGCTCCTTCTGGC 2 ATAAGGTGCATCTAGTGCAGATA 25 TGAGGTAG 阅读全文
posted @ 2022-08-14 16:10 小鲨鱼2018 阅读(70) 评论(0) 推荐(0)
摘要: 001、方法1 root@PC1:/home/test3# ls test.py root@PC1:/home/test3# cat test.py ## 测试程序 #!/usr/bin/python result = "" str1 = "ACGTACGTACGTCACGTCAGCTAGAC" # 阅读全文
posted @ 2022-08-14 15:30 小鲨鱼2018 阅读(170) 评论(0) 推荐(0)
摘要: 001、 root@PC1:/home/test3# ls a.txt test.py root@PC1:/home/test3# cat test.py ## 测试程序 #!/usr/bin/python in_file = open("a.txt", "r") lines = in_file.r 阅读全文
posted @ 2022-08-14 14:53 小鲨鱼2018 阅读(397) 评论(0) 推荐(0)
摘要: 001、 >>> "{0}".format("xxx") ## 位置参数 'xxx' >>> "{0}.{1}.{2}".format("xxx", "yyy", "zzz") 'xxx.yyy.zzz' >>> "\t{0}.{1}.{2}".format("xxx", "yyy", "zzz") 阅读全文
posted @ 2022-08-14 14:09 小鲨鱼2018 阅读(41) 评论(0) 推荐(0)
摘要: 001、 #include <stdio.h> int main(void) { int i; int result = 0; printf("i = "); scanf("%d", &i); while(i > 0) { result = result * 10 + i % 10; i /= 10 阅读全文
posted @ 2022-08-14 02:44 小鲨鱼2018 阅读(37) 评论(0) 推荐(0)
摘要: 001、 在函数定义中, 形参名不能和函数内部的变量同名, 否则会发生冲突。 002、 定义不同函数时, 可以使用不能的形参名, 因为虽然同名,但是分别属于不同的函数。 003、 在函数调用过程中, 实参可以和形参同名, 因为实参不属于调用函数的部分。 阅读全文
posted @ 2022-08-14 01:41 小鲨鱼2018 阅读(1338) 评论(0) 推荐(0)
摘要: 001、 #include <stdio.h> //以下为函数定义 int max2(int a, int b) // 该句称为函数头;int 表示函数返回类型; max2表示函数名; int a 和int b为形参声明。 { if(a > b) return a; //此处花括号内为函数体 els 阅读全文
posted @ 2022-08-14 01:07 小鲨鱼2018 阅读(535) 评论(0) 推荐(0)
上一页 1 ··· 185 186 187 188 189 190 191 192 193 ··· 403 下一页