python缩进 作者: admin 时间: 23/01/30 07:09:21 分类: Python 有人能告诉我什么是缩进吗? # 回答1 缩进是Python知道什么是"块"的方式.块用于循环、If/Else、函数定义、类等.例如: 选择 | 换行 | 行号 for i in range(5): # begin for loop block print i # indented (usually 4 spaces, sometimes 1 tab) print "hello" # not indented, not in the block above it. 这是Python(IMO)最酷的特性之一.没有标签,没有分号,没有括号--只有适量的空格. 标签: python