python学习

之前每次都是粗略的看看,现在开始决定,好好学习下python这个玩意。

会同步在此处更新学习笔记。


官方网站:

http://www.python.org/    获取最新的代码、文档、新闻

An example: 

kyle@ubuntu:~/workspace$ python
Python 2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print "Hello World"
Hello World

标示符:

命令俗成:

  • Class names start with anuppercaseletter and all other identifiers with a lowercase letter.

  • Starting an identifier with a single leading underscore(_) indicates by convention that the identifier is meant to beprivate.

  • Starting an identifier with two leading underscores indicates a strongly private identifier.

  • If the identifier also ends with two trailing underscores, the identifier is alanguage-defined special name.

保留关键字:

and exec not
assert finally or
break for pass
class from print
continue global raise
def if return
del import try
elif in while
else is with
except lambda yield

python里没有大括号,靠缩进。


Python has five standard data types:

  • Numbers:   int / long / float / complex

  • String: 

    str = 'Hello World!'

  • List

    list = [ 'abcd', 786 , 2.23, 'john', 70.2 ]

  • 
    
  • Tuple:

  • Tuples can be thought of as read-only lists.

  • tuple = ( 'abcd', 786 , 2.23, 'john', 70.2 )

  • Dictionary




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值