hello python!

hello python!

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

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

运行主程序:IDLE(Python GUI)

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

print "hello python!"

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

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

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

i=1
j=2
i+j

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

print"this is "+i

点击Run-run Module

数组元素的相加

字符串与数字相乘


从字符串中查找匹配

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

 

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

 

 

#!/usr/bin/env python2
# -*- coding: utf-8 -*-

#LICENSE: WTFPL
#DEPENDS: on this cool font from http://asdasd.rpg.fi/~svo/glasstty/
#TODO: port to Python3

from time import sleep
from sys import stdout

anim = ["|", "/", "-", "\\"]
while True:
    for c in anim:
        print "Loading (0 %)", c, "\r",
        stdout.flush()
        sleep(0.1)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值