while True:
password = ''
# Generate password
for _ in range(length):
password += secrets.choice(all_characters)
I belive my while True loop is correct.I am not able to complete this step due to level of indentation. I am doing what this post say
Also, my editor doesn’t report any error …the script run pefectly.
I am wondering if you can give me a trick to easily find out the issue with the level of indentation.
Dear Ilenia…I am trying and trying but nothing. What is strange that on my editor code run without any issue. And my editor does the indentation automatically . What I am doing wrong??
the script below run without problem in my editor.
import secrets
import string
def generate_password(length):
# Define the possible characters for the password
letters = string.ascii_letters
digits = string.digits
symbols = string.punctuation
# Combine all characters
all_characters = letters + digits + symbols
while True:
password = ''
# Generate password
for _ in range(length):
password += secrets.choice(all_characters)
return password
# new_password = generate_password(8)
# print(new_password)
Guys…I do not know… This is not normal, I can not move to the next step. I did all the indentation combinations but nothing. I made the code in my Visual studio code and run it immediately and worked fine. It from last night that I am not able to move on.