(1, 2, 3)
>>> print 1,2,3
1 2 3
>>> print(1,2,3)
(1, 2, 3)
注意:python3.0以后,print不再是语句,而是函数,函数要加上括号
2、...(循环语句)的一组语句
在代码前放置空格来缩进语句即可创建语句块,在python中用冒号(:)用来标识语句快的开始巨快中的每个语句都是缩进相同的
条件和条件语句
布尔变量
真值
下列值作为布尔表达式会被解释器看做假...'s' in name:
print ("true")
else:
print ("false")
字符串和序列的比较
字符串可以按照字母顺序排列进行比较
>>> "alpha"<"beta...print ('the word was '+word)
While True实现永远不会自己停止的循环
循环中的else子句
from math import sqrt
for n in range(...exec
-------执行一个字符串的函数(python 3.0),动态创建 代码字符串
>>> exec ("print ('hello,world')")
hello,world
-----简单的使用不妥当