1、注释是以# 开头的,# 右边该行内容均为注释内容
# begin with '#' means it is a comment statement
2、代码块是有冒号:及其后面的缩进行组成的
# end with ':' means the following is a statement block
value = -100
if value >= 0:
print value
else:
print -value
3、多行输出
可以使用多个print,也可以使用一个print实现多行输出
# '''......''' ,r'''......''' or end with '\' can contain Multi lines
print r'''line1
line2
line3'''
print 'line4\n\
line5\n\
line6'
# use print more than once
print 'line7'
print 'line8'
print 'line9'
运行效果:
4、忽略转义符的输出
# r'......' define ...... isn`t Escape Char
print r'\\\t\\','or','\\\t\\'
运行效果: