2024-04-20 05:14:20 发布
网友
你好,我有一个问题,使我的验证,迫使用户输入5个字,目前如果他们输入一个空间,他们也可以去槽。这是我的密码:
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)
words = sentence.split() if len(words) == 5: print('good')
或者使用all()添加一个“is\u word”测试来应用于“words”,以防拒绝数字或其他内容。你知道吗
或者使用all()添加一个“is\u word”测试来应用于“words”,以防拒绝数字或其他内容。你知道吗
相关问题 更多 >
编程相关推荐