Documentation
This large block of commented-out code should be deleted to reduce clutter:
#needs some fix, de-comment this to see.
'''
for idx, char in enumerate(senha): #this is the code i need help. look at the '#string scrambler' to see an better code than this here with same objective.
for step in range(len(lista[3])):
if lista[5][step] == 1:
continue
Alternate versions of code can be stored in you version control system during development.
thereThere is no need for long lines inside a docstring:
This function creates an list (like string) with some caracters of the password, then a code to the password with the list made, which is allways the same for the same password.\n
That line should be shortened by splitting it up into multiple lines.
Many of the lines in the doctring end in literal \n characters which can be deleted:
Then checks to the mode:\n
Simpler
This line:
if debug == True:
is simpler as:
if debug:
This line:
print(f"Password was really wrong.")
is simpler without the f-string:
print("Password was really wrong.")
ruff identifies other similar issues.
Naming
The PEP 8 style guide recommends snake_case for function and variable names.
The function name coddecod is strange. Perhaps code_decode is more meaningful.
The variable reallywrongpassword would be really_wrong_password.
senha does not convey much meaning in English. Either choose a more descriptive name or
add a comment to describe what it means. The same is true for other variables like lista, etc.