Python 3.0、3.1、3.2中的“ ValueError:格式为零长度的字段名称”错误
我正在尝试学习Python(具体来说是3),并且遇到了以下错误: ValueError: zero length field name in format 我用谷歌搜索,发现需要指定数字: a, b = 0, 1 if a < b: print('a ({0}) is less than b ({1})'.format(a, b)) else: print('a ({0}) is not less than b ({1})'.format(a, b)) 而且不像本教程(来自lynda.com)实际所说的那样: a, b = 0, 1 if a < b: print('a ({}) is less …