读书人

hello python

发布时间: 2012-11-20 09:55:43 作者: rapoo

hello python!

hello python!

在编写钱首先下载python程序! 软件下载请到官方网站www.python.org 下载

选择download 选择适合你的应用平台 (大多是windows的用户所以选windows项现在)

运行主程序:IDLE(Python GUI)

hello python

然后直接在命令行中 输入 :

print "hello python!"

就可已显示出一个helloworld!,这时 你的第一个python程序就已经完成了

python不需要main函数 所以在做脚本语言中很不错!

下面来完成一个简单的运算

i=1j=2i+j

hello python

我们也可以用文本进行编辑 点File-New windows然后程序自动打开一个文本编辑器
i=raw_input()

print"this is "+i

点击Run-run Module

hello python

数组元素的相加

hello python

字符串与数字相乘

hello python

从字符串中查找匹配

hello python

方法使用 len() max() min()

hello python

分解字符串list(" ") 与替换数组元素number[x,y,z,e,f] 删除元素del number[x]

hello python

读书人网 >perl python

热点推荐