第一章 Python起步

2017-06-29  本文已影响0人  Akushu

>>> print 'hello world'

hello world

>>> abs(-4)

4

>>> string = "hello world!"

>>> print string

hello world!

>>> string

'hello world!'

>>> python主提示符号,表示正在等待输入下一个语句

... python次提示符号,表示正在等待输入当前语句的其他部分

>>> _

'hello world!'

_在解释器中表示最后一个表达式的值。

>>> print "%s is number %d!" % ("Python", 1)

Python is number 1!

类C中的printf()

example for comment, >>> and ...

>>> #one comment

... print 'Hello World' #another comment

Hello World

python不支持++和--

上一篇 下一篇

猜你喜欢

热点阅读