TickingClock的个人博客分享 http://blog.sciencenet.cn/u/TickingClock

博文

Rosalind 1 - Installing Python

已有 2447 次阅读 2017-10-18 09:05 |个人分类:Python Learning|系统分类:科研笔记

Python Village - INI1: Installing Python

首先下载你的操作平台适合的Python,地址:http://wiki.python.org/moin/BeginnersGuide/Download


安装完之后,运行IDLE,出现一个界面,内有3个箭头,代表一切正常,可以输入指令了


>>>


试试输入“1+1”,看看结果:


>>>1+1
2

>>>


可以看到返回值为2,代表你输入了指令1+1,Python给你返回了1+1的结果。


另外,也可以新建一个文档,然后命名,比如“hello.py”,在文档中写入


print “Hello, World!”


之后用Python运行该文档(IDLE中选择File→New Window→写入脚本→Run→Run Module;命令行下直接python hello.py),Python返回:


Hello, World!


👌,已经学会Python的第一个编程了,恭喜!


Problem


After downloading and installing Python, type import this into the Python command line and see what happens. Then, click the "Download dataset" button below and copy the Zen of Python into the space provided.


这个很简单,安装完Python后,输入“import this”指令,然后得到Python返回值就行:


>>> import this

The Zen of Python, by Tim Peters


Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

>>>


Over


Rosalind is a platform for learning bioinformatics and programming through problem solving. Take a tour to get the hang of how Rosalind works.


P.S. 欢迎关注微信公众号:微信号Plant_Frontiers


https://blog.sciencenet.cn/blog-3158122-1081308.html

上一篇:the plant journal:短柄草的ABA受体家族基因功能非冗余
下一篇:Rosalind 2 - Variables and Some Arithmetic
收藏 IP: 221.181.145.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...
扫一扫,分享此博文

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

GMT+8, 2024-4-25 17:22

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部