Python基础

  Python的语法采用缩进方式,写出来的代码就像下面的样子:

1 # print absolute value of an integer:
2 a = 100
3 if a >= 0:
4     print(a)
5 else:
6     print(-a)

  以#开头的语句是注释,解释器会忽略掉注释。其他每一行都是一个语句,当语句以冒号结尾时,缩进的语句视为代码块。

原文地址:https://www.cnblogs.com/lucky-zhangcd/p/9073779.html