-3
你好,我有一个问题,使我的验证,强制用户输入5个单词,目前如果他们进入一个空间,他们可以去槽也。这里是我的代码:Python数据验证字
cntr = 0
for x in range(len(this.val)):
if this.val[x]. == ' ' and not this.val[x-1] == ' ' and x != 0:
cntr = cntr + 1
if cntr lt 4:
error(res.Q3error)
什么是'this.val'?你的代码是无效的python – 2014-09-23 23:07:08
欢迎来到StackOverflow,为了得到答案,请阅读并遵循本[指南](http://stackoverflow.com/help/how-to-ask)。 – 2014-09-23 23:19:49