博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
求DNA序列中各个碱基的含量
阅读量:4561 次
发布时间:2019-06-08

本文共 504 字,大约阅读时间需要 1 分钟。

方法很简单,用count就可以了,

with open (r'D:\Rosalind\rosalind_dna.txt','r') as f:    for nucleotide in f.readlines():        num_A = nucleotide.count("A")        num_G = nucleotide.count("G")        num_C = nucleotide.count("C")        num_T = nucleotide.count("T")        print ("The numbers of 'A' ====> " + str(num_A))print ("The numbers of 'G' ====> " + str(num_G))print ("The numbers of 'C' ====> " + str(num_C))print ("The numbers of 'T' ====> " + str(num_T))

 

转载于:https://www.cnblogs.com/nklzj/p/6273181.html

你可能感兴趣的文章
SQL COOKBOOK (Ch.1-10)
查看>>
创建数组
查看>>
dict使用
查看>>
[转] 移动平台Html5的viewport使用经验
查看>>
ASP.NET MVC的帮助类HtmlHelper和UrlHelper
查看>>
《Python数据科学手册》第五章机器学习的笔记
查看>>
ubuntu16.04 配置爬虫环境
查看>>
Centos7,PHP7安装swoole
查看>>
02_ListActive中响应事件 并LogCat输出
查看>>
doubleclick adx note
查看>>
Celery框架
查看>>
[c#]asp.net开发微信公众平台(4)关注事件、用户记录、回复文本消息
查看>>
[转载,感觉写的非常详细]DUBBO配置方式详解
查看>>
linux Valgrind使用说明-内存泄漏
查看>>
Android在Eclipse上的环境配置
查看>>
面向对象(五)
查看>>
android平台下使用点九PNG技术
查看>>
Python学习3,列表
查看>>
最长回文子串
查看>>
JAVA基础-JDBC(一)
查看>>