嗨,我正在尝试修复这个属性错误,并且已经做了一天半了。我是python新手,尝试将结构化英语代码(伪代码)转换为项目的Python3
Output:
Traceback (most recent call last):
File "test.py", line 31, in <module>
passwordVerifier(password)
File "test.py", line 16, in passwordVerifier
passwordArray = password.length()
AttributeError: 'int' object has no attribute 'length'
#!/bin/python3
import os
import sys
import numpy
import office2john
def passwordVerifier(password):
password = str(password)
verifier = [numpy.uint16(1)]
passwordArray = [numpy.uint8(1)]
verifier = 0x0000
passwordArray = [0]
passwordArray = bytes([])
passwordArray = password.length()
for password in passwordArray:
intermediate1 = 0
if password in passwordArray:
intermediate1 = 1
else:
intermediate2 = verifier * 2
intermediate3 = intermediate1
verifier = intermediate3
return verifier
passwordArray = len(password)
要检查字符串的长度,请使用
len
因此
int
passwordArray = len(str(password))
相关问题 更多 >
编程相关推荐