科学网

 找回密码
  注册
Rosalind 5 - Working with Files
郝兆东 2017-10-21 08:08
Python Village - INI5: Working with Files Reading and Writing Python中读写文件是用的open()函数,共有三种模式:r(read mode),w(write mode)和a(append mode)。 比如,我们新建一个txt文档,命名为input.txt,然后粘贴进 Bravely bold Sir Robin rode forth from Camelot Yes, brave ...
个人分类: Python Learning|3729 次阅读|没有评论
Rosalind 4 - Conditions and Loops
郝兆东 2017-10-20 08:47
Python Village - INI4: Conditions and Loops Python中的条件语句if: a = 42 if a 10: ... print 'the number is less than 10' ... else: ... print 'the number is greater or equal ...
个人分类: Python Learning|3268 次阅读|没有评论
Rosalind 3 - Strings and Lists
郝兆东 2017-10-19 08:31
Python Village - INI3: Strings and Lists Python除了strings和numbers数据类型,还有更加复杂一点的数据类型,比如说lists。 list的赋值方式是 list_name = ,比如: tea_party = print tea_party Dormouse 注意,在Python中,list内部item计数是从0开始的 ...
个人分类: Python Learning|3097 次阅读|没有评论
Rosalind 2 - Variables and Some Arithmetic
郝兆东 2017-10-18 09:09
Python Village - INI2: Variables and Some Arithmetic 变量Variables,是计算机语言中能储存计算结果或能表示值抽象概念。 在Python中,基础的数据类型分为strings和numbers。numbers有两类:integers(整数,包括正数与负数)和floats(浮点数,带有小数点)。可以通过下面的方法赋予变量以数值: ...
个人分类: Python Learning|3008 次阅读|没有评论
Rosalind 1 - Installing Python
郝兆东 2017-10-18 09:05
Python Village - INI1: Installing Python 首先下载你的操作平台适合的Python,地址: http://wiki.python.org/moin/BeginnersGuide/Download 安装完之后,运行 IDLE ,出现一个界面,内有3个箭头,代表一切正常,可以输入指令了 试试输入“1+1”,看看结果: 1+1 2 ...
个人分类: Python Learning|2647 次阅读|没有评论

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-9-22 06:01

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部